Commit 096f806b authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Switch renderer/modules/ away from base::RefCountedThreadSafe

Blink uses its own WTF::ThreadSafeRefCounted instead.

BUG=787254
R=guidou@chromium.org

Change-Id: I468ec63f649381e0d2bc3e9b76472992d87605ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1887370
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712221}
parent c150ae4d
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/location.h" #include "base/location.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "media/base/bind_to_current_loop.h" #include "media/base/bind_to_current_loop.h"
#include "media/capture/video_capture_types.h" #include "media/capture/video_capture_types.h"
...@@ -44,7 +43,7 @@ void ResetCallback( ...@@ -44,7 +43,7 @@ void ResetCallback(
// is disabled, a black frame is instead forwarded to the sinks at the same // is disabled, a black frame is instead forwarded to the sinks at the same
// frame rate. // frame rate.
class MediaStreamVideoTrack::FrameDeliverer class MediaStreamVideoTrack::FrameDeliverer
: public base::RefCountedThreadSafe<FrameDeliverer> { : public WTF::ThreadSafeRefCounted<FrameDeliverer> {
public: public:
using VideoSinkId = WebMediaStreamSink*; using VideoSinkId = WebMediaStreamSink*;
...@@ -70,7 +69,7 @@ class MediaStreamVideoTrack::FrameDeliverer ...@@ -70,7 +69,7 @@ class MediaStreamVideoTrack::FrameDeliverer
base::TimeTicks estimated_capture_time); base::TimeTicks estimated_capture_time);
private: private:
friend class base::RefCountedThreadSafe<FrameDeliverer>; friend class WTF::ThreadSafeRefCounted<FrameDeliverer>;
virtual ~FrameDeliverer(); virtual ~FrameDeliverer();
void AddCallbackOnIO(VideoSinkId id, void AddCallbackOnIO(VideoSinkId id,
VideoCaptureDeliverFrameInternalCallback callback); VideoCaptureDeliverFrameInternalCallback callback);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "third_party/blink/public/platform/web_rtc_session_description.h" #include "third_party/blink/public/platform/web_rtc_session_description.h"
#include "third_party/blink/public/platform/web_rtc_stats.h" #include "third_party/blink/public/platform/web_rtc_stats.h"
#include "third_party/blink/public/platform/web_vector.h" #include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h"
#include "third_party/webrtc/api/stats/rtc_stats.h" #include "third_party/webrtc/api/stats/rtc_stats.h"
namespace blink { namespace blink {
...@@ -24,7 +25,7 @@ namespace { ...@@ -24,7 +25,7 @@ namespace {
// Having a refcounted helper class allows multiple DummyWebRTCRtpSender to // Having a refcounted helper class allows multiple DummyWebRTCRtpSender to
// share the same internal states. // share the same internal states.
class DummyRtpSenderInternal class DummyRtpSenderInternal
: public base::RefCountedThreadSafe<DummyRtpSenderInternal> { : public WTF::ThreadSafeRefCounted<DummyRtpSenderInternal> {
private: private:
static uintptr_t last_id_; static uintptr_t last_id_;
...@@ -46,7 +47,8 @@ uintptr_t DummyRtpSenderInternal::last_id_ = 0; ...@@ -46,7 +47,8 @@ uintptr_t DummyRtpSenderInternal::last_id_ = 0;
class DummyWebRTCRtpSender : public WebRTCRtpSender { class DummyWebRTCRtpSender : public WebRTCRtpSender {
public: public:
explicit DummyWebRTCRtpSender(WebMediaStreamTrack track) explicit DummyWebRTCRtpSender(WebMediaStreamTrack track)
: internal_(new DummyRtpSenderInternal(std::move(track))) {} : internal_(
base::MakeRefCounted<DummyRtpSenderInternal>(std::move(track))) {}
DummyWebRTCRtpSender(const DummyWebRTCRtpSender& other) DummyWebRTCRtpSender(const DummyWebRTCRtpSender& other)
: internal_(other.internal_) {} : internal_(other.internal_) {}
~DummyWebRTCRtpSender() override {} ~DummyWebRTCRtpSender() override {}
...@@ -154,7 +156,7 @@ uintptr_t DummyWebRTCRtpReceiver::last_id_ = 0; ...@@ -154,7 +156,7 @@ uintptr_t DummyWebRTCRtpReceiver::last_id_ = 0;
// Having a refcounted helper class allows multiple DummyWebRTCRtpTransceivers // Having a refcounted helper class allows multiple DummyWebRTCRtpTransceivers
// to share the same internal states. // to share the same internal states.
class DummyTransceiverInternal class DummyTransceiverInternal
: public base::RefCountedThreadSafe<DummyTransceiverInternal> { : public WTF::ThreadSafeRefCounted<DummyTransceiverInternal> {
private: private:
static uintptr_t last_id_; static uintptr_t last_id_;
...@@ -199,7 +201,8 @@ class MockWebRTCPeerConnectionHandler::DummyWebRTCRtpTransceiver ...@@ -199,7 +201,8 @@ class MockWebRTCPeerConnectionHandler::DummyWebRTCRtpTransceiver
public: public:
DummyWebRTCRtpTransceiver(WebMediaStreamSource::Type type, DummyWebRTCRtpTransceiver(WebMediaStreamSource::Type type,
WebMediaStreamTrack track) WebMediaStreamTrack track)
: internal_(new DummyTransceiverInternal(type, track)) {} : internal_(base::MakeRefCounted<DummyTransceiverInternal>(type, track)) {
}
DummyWebRTCRtpTransceiver(const DummyWebRTCRtpTransceiver& other) DummyWebRTCRtpTransceiver(const DummyWebRTCRtpTransceiver& other)
: internal_(other.internal_) {} : internal_(other.internal_) {}
~DummyWebRTCRtpTransceiver() override {} ~DummyWebRTCRtpTransceiver() override {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment