Commit fd970363 authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

[RTCPeerConnection] Consolidate CossThreadCopier<rtc::scoped_refptr<T>>

This copier is currently defined in two places and it is expected to
be used in upcoming code for insertable streams.

Bug: 1052765
Change-Id: I25d7bed81a4c4ab823ecbbc3614aa17e4c8ac957
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2069331Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744198}
parent cf0db7ca
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "third_party/blink/renderer/platform/peerconnection/rtc_offer_options_platform.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_offer_options_platform.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_rtp_transceiver_platform.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_rtp_transceiver_platform.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_scoped_refptr_cross_thread_copier.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_session_description_platform.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_session_description_platform.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_session_description_request.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_session_description_request.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_stats.h" #include "third_party/blink/renderer/platform/peerconnection/rtc_stats.h"
...@@ -96,13 +97,6 @@ struct CrossThreadCopier< ...@@ -96,13 +97,6 @@ struct CrossThreadCopier<
STATIC_ONLY(CrossThreadCopier); STATIC_ONLY(CrossThreadCopier);
}; };
template <typename T>
struct CrossThreadCopier<rtc::scoped_refptr<T>> {
STATIC_ONLY(CrossThreadCopier);
using Type = rtc::scoped_refptr<T>;
static Type Copy(Type pointer) { return pointer; }
};
} // namespace WTF } // namespace WTF
namespace blink { namespace blink {
......
...@@ -1282,6 +1282,7 @@ jumbo_component("platform") { ...@@ -1282,6 +1282,7 @@ jumbo_component("platform") {
"peerconnection/rtc_rtp_source.h", "peerconnection/rtc_rtp_source.h",
"peerconnection/rtc_rtp_transceiver_platform.cc", "peerconnection/rtc_rtp_transceiver_platform.cc",
"peerconnection/rtc_rtp_transceiver_platform.h", "peerconnection/rtc_rtp_transceiver_platform.h",
"peerconnection/rtc_scoped_refptr_cross_thread_copier.h",
"peerconnection/rtc_session_description_platform.cc", "peerconnection/rtc_session_description_platform.cc",
"peerconnection/rtc_session_description_platform.h", "peerconnection/rtc_session_description_platform.h",
"peerconnection/rtc_session_description_request.h", "peerconnection/rtc_session_description_request.h",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_SCOPED_REFPTR_CROSS_THREAD_COPIER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_SCOPED_REFPTR_CROSS_THREAD_COPIER_H_
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier.h"
#include "third_party/webrtc/api/scoped_refptr.h"
namespace WTF {
template <typename T>
struct CrossThreadCopier<rtc::scoped_refptr<T>> {
STATIC_ONLY(CrossThreadCopier);
using Type = rtc::scoped_refptr<T>;
static Type Copy(Type pointer) { return pointer; }
};
} // namespace WTF
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_SCOPED_REFPTR_CROSS_THREAD_COPIER_H_
...@@ -12,22 +12,12 @@ ...@@ -12,22 +12,12 @@
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_scoped_refptr_cross_thread_copier.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/webrtc/api/stats/rtc_stats.h" #include "third_party/webrtc/api/stats/rtc_stats.h"
#include "third_party/webrtc/api/stats/rtcstats_objects.h" #include "third_party/webrtc/api/stats/rtcstats_objects.h"
namespace WTF {
template <typename T>
struct CrossThreadCopier<rtc::scoped_refptr<T>> {
STATIC_ONLY(CrossThreadCopier);
using Type = rtc::scoped_refptr<T>;
static Type Copy(Type pointer) { return pointer; }
};
} // namespace WTF
namespace blink { namespace blink {
namespace { namespace {
......
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