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) {
diff --git a/test/fuzzers/sdp_integration_fuzzer.cc b/test/fuzzers/sdp_integration_fuzzer.cc
index 2a8be39..ece4b50 100644
--- a/test/fuzzers/sdp_integration_fuzzer.cc
+++ b/test/fuzzers/sdp_integration_fuzzer.cc
@@ -27,22 +27,21 @@
     // generated are discarded.
 
     auto srd_observer =
-        rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+        rtc::make_ref_counted<FakeSetRemoteDescriptionObserver>();
 
     SdpParseError error;
     std::unique_ptr<SessionDescriptionInterface> sdp(
         CreateSessionDescription("offer", std::string(message), &error));
-    // Note: This form of SRD takes ownership of the description.
-    caller()->pc()->SetRemoteDescription(srd_observer, sdp.release());
+    caller()->pc()->SetRemoteDescription(std::move(sdp), srd_observer);
     // Wait a short time for observer to be called. Timeout is short
     // because the fuzzer should be trying many branches.
     EXPECT_TRUE_WAIT(srd_observer->called(), 100);
 
     // If set-remote-description was successful, try to answer.
     auto sld_observer =
-        rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
-    if (srd_observer->result()) {
-      caller()->pc()->SetLocalDescription(sld_observer.get());
+        rtc::make_ref_counted<FakeSetLocalDescriptionObserver>();
+    if (srd_observer->error().ok()) {
+      caller()->pc()->SetLocalDescription(sld_observer);
       EXPECT_TRUE_WAIT(sld_observer->called(), 100);
     }
     // If there is an EXPECT failure, die here.