Delete implicit conversion from rtc::scoped_refptr<T> to T*

Bug: webrtc:13464
Change-Id: I24c742c11a4ea5c4e307e170ee4fbd4e81cf1814
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260325
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36808}
diff --git a/api/scoped_refptr.h b/api/scoped_refptr.h
index b1c90fc..e145509 100644
--- a/api/scoped_refptr.h
+++ b/api/scoped_refptr.h
@@ -105,8 +105,6 @@
 
   T* get() const { return ptr_; }
   explicit operator bool() const { return ptr_ != nullptr; }
-  // TODO(bugs.webrtc.org/13464): Delete this conversion operator.
-  operator T*() const { return ptr_; }
   T& operator*() const { return *ptr_; }
   T* operator->() const { return ptr_; }
 
@@ -194,6 +192,25 @@
   return !(a == nullptr);
 }
 
+// Comparison with raw pointer.
+template <typename T, typename U>
+bool operator==(const rtc::scoped_refptr<T>& a, const U* b) {
+  return a.get() == b;
+}
+template <typename T, typename U>
+bool operator!=(const rtc::scoped_refptr<T>& a, const U* b) {
+  return !(a == b);
+}
+
+template <typename T, typename U>
+bool operator==(const T* a, const rtc::scoped_refptr<U>& b) {
+  return a == b.get();
+}
+template <typename T, typename U>
+bool operator!=(const T* a, const rtc::scoped_refptr<U>& b) {
+  return !(a == b);
+}
+
 // Ordered comparison, needed for use as a std::map key.
 template <typename T, typename U>
 bool operator<(const rtc::scoped_refptr<T>& a, const rtc::scoped_refptr<U>& b) {