Commit 7f04e1dc authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Onion soup content/renderer/media/webrtc/rtc_certificate_generator.cc

This is phase 6.2 on the design document [1].

CL moves RTCCertificateGenerator directly to blink/renderer, once its
solely clients all reside in blink/renderer now.
The existing base class WebRTCCertificateGenerator, needed to bridge
between blink and content will be removed in a follow up step.

The CL also removes the existing accessor in blink::Platform, and
removes Mock implementations in
//content/test/test_blink_web_unit_test_support.cc|h

BUG=787254
R=guidou@chromium.org, haraken@chromium.org

Change-Id: I7d065a3d9344d779c65938c174c74d82e71a8716
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814604
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarTommi <tommi@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704581}
parent 072b939b
...@@ -202,8 +202,6 @@ target(link_target_type, "renderer") { ...@@ -202,8 +202,6 @@ target(link_target_type, "renderer") {
"media/webrtc/media_stream_track_metrics.h", "media/webrtc/media_stream_track_metrics.h",
"media/webrtc/peer_connection_tracker.cc", "media/webrtc/peer_connection_tracker.cc",
"media/webrtc/peer_connection_tracker.h", "media/webrtc/peer_connection_tracker.h",
"media/webrtc/rtc_certificate_generator.cc",
"media/webrtc/rtc_certificate_generator.h",
"media/webrtc/rtc_peer_connection_handler.cc", "media/webrtc/rtc_peer_connection_handler.cc",
"media/webrtc/rtc_peer_connection_handler.h", "media/webrtc/rtc_peer_connection_handler.h",
"media/webrtc/rtc_rtp_receiver.cc", "media/webrtc/rtc_rtp_receiver.cc",
......
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
#include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h" #include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h"
#include "third_party/blink/public/platform/url_conversion.h" #include "third_party/blink/public/platform/url_conversion.h"
#include "third_party/blink/public/platform/web_audio_latency_hint.h" #include "third_party/blink/public/platform/web_audio_latency_hint.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h" #include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h"
#include "third_party/blink/public/platform/web_security_origin.h" #include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_theme_engine.h" #include "third_party/blink/public/platform/web_theme_engine.h"
...@@ -116,7 +115,6 @@ ...@@ -116,7 +115,6 @@
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#endif #endif
#include "content/renderer/media/webrtc/rtc_certificate_generator.h"
#include "third_party/blink/public/platform/modules/mediastream/webrtc_uma_histograms.h" #include "third_party/blink/public/platform/modules/mediastream/webrtc_uma_histograms.h"
using blink::Platform; using blink::Platform;
...@@ -552,13 +550,6 @@ RendererBlinkPlatformImpl::CreateRTCPeerConnectionHandler( ...@@ -552,13 +550,6 @@ RendererBlinkPlatformImpl::CreateRTCPeerConnectionHandler(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::unique_ptr<blink::WebRTCCertificateGenerator>
RendererBlinkPlatformImpl::CreateRTCCertificateGenerator() {
return std::make_unique<RTCCertificateGenerator>();
}
//------------------------------------------------------------------------------
scoped_refptr<base::SingleThreadTaskRunner> scoped_refptr<base::SingleThreadTaskRunner>
RendererBlinkPlatformImpl::GetWebRtcWorkerThread() { RendererBlinkPlatformImpl::GetWebRtcWorkerThread() {
auto* rtc_dependency_factory = auto* rtc_dependency_factory =
......
...@@ -130,8 +130,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -130,8 +130,6 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
CreateRTCPeerConnectionHandler( CreateRTCPeerConnectionHandler(
blink::WebRTCPeerConnectionHandlerClient* client, blink::WebRTCPeerConnectionHandlerClient* client,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; scoped_refptr<base::SingleThreadTaskRunner> task_runner) override;
std::unique_ptr<blink::WebRTCCertificateGenerator>
CreateRTCCertificateGenerator() override;
scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerThread() override; scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcWorkerThread() override;
rtc::Thread* GetWebRtcWorkerThreadRtcThread() override; rtc::Thread* GetWebRtcWorkerThreadRtcThread() override;
scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcSignalingTaskRunner() scoped_refptr<base::SingleThreadTaskRunner> GetWebRtcSignalingTaskRunner()
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "third_party/blink/public/platform/web_connection_type.h" #include "third_party/blink/public/platform/web_connection_type.h"
#include "third_party/blink/public/platform/web_data.h" #include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/platform/web_network_state_notifier.h" #include "third_party/blink/public/platform/web_network_state_notifier.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/public/platform/web_runtime_features.h" #include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/platform/web_url.h"
...@@ -298,43 +297,6 @@ bool TestBlinkWebUnitTestSupport::IsThreadedAnimationEnabled() { ...@@ -298,43 +297,6 @@ bool TestBlinkWebUnitTestSupport::IsThreadedAnimationEnabled() {
return threaded_animation_; return threaded_animation_;
} }
namespace {
class TestWebRTCCertificateGenerator
: public blink::WebRTCCertificateGenerator {
void GenerateCertificate(
const blink::WebRTCKeyParams& key_params,
blink::WebRTCCertificateCallback completion_callback,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) override {
NOTIMPLEMENTED();
}
void GenerateCertificateWithExpiration(
const blink::WebRTCKeyParams& key_params,
uint64_t expires_ms,
blink::WebRTCCertificateCallback completion_callback,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) override {
NOTIMPLEMENTED();
}
bool IsSupportedKeyParams(const blink::WebRTCKeyParams& key_params) override {
return false;
}
rtc::scoped_refptr<rtc::RTCCertificate> FromPEM(
blink::WebString pem_private_key,
blink::WebString pem_certificate) override {
rtc::scoped_refptr<rtc::RTCCertificate> certificate =
rtc::RTCCertificate::FromPEM(rtc::RTCCertificatePEM(
pem_private_key.Utf8(), pem_certificate.Utf8()));
return certificate;
}
};
} // namespace
std::unique_ptr<blink::WebRTCCertificateGenerator>
TestBlinkWebUnitTestSupport::CreateRTCCertificateGenerator() {
return std::make_unique<TestWebRTCCertificateGenerator>();
}
void TestBlinkWebUnitTestSupport::BindClipboardHost( void TestBlinkWebUnitTestSupport::BindClipboardHost(
mojo::ScopedMessagePipeHandle handle) { mojo::ScopedMessagePipeHandle handle) {
mock_clipboard_host_->Bind( mock_clipboard_host_->Bind(
......
...@@ -62,9 +62,6 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { ...@@ -62,9 +62,6 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {
bool IsThreadedAnimationEnabled() override; bool IsThreadedAnimationEnabled() override;
std::unique_ptr<blink::WebRTCCertificateGenerator>
CreateRTCCertificateGenerator() override;
// May be called when |this| is registered as the active blink Platform // May be called when |this| is registered as the active blink Platform
// implementation. Overrides the result of IsThreadedAnimationEnabled() to // implementation. Overrides the result of IsThreadedAnimationEnabled() to
// the provided value, and returns the value it was set to before the call. // the provided value, and returns the value it was set to before the call.
......
...@@ -125,7 +125,6 @@ class WebLocalFrame; ...@@ -125,7 +125,6 @@ class WebLocalFrame;
class WebMediaCapabilitiesClient; class WebMediaCapabilitiesClient;
class WebPrescientNetworking; class WebPrescientNetworking;
class WebPublicSuffixList; class WebPublicSuffixList;
class WebRTCCertificateGenerator;
class WebRTCPeerConnectionHandler; class WebRTCPeerConnectionHandler;
class WebRTCPeerConnectionHandlerClient; class WebRTCPeerConnectionHandlerClient;
class WebSandboxSupport; class WebSandboxSupport;
...@@ -575,11 +574,6 @@ class BLINK_PLATFORM_EXPORT Platform { ...@@ -575,11 +574,6 @@ class BLINK_PLATFORM_EXPORT Platform {
CreateRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient*, CreateRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient*,
scoped_refptr<base::SingleThreadTaskRunner>); scoped_refptr<base::SingleThreadTaskRunner>);
// May return null if WebRTC functionality is not available or out of
// resources.
virtual std::unique_ptr<WebRTCCertificateGenerator>
CreateRTCCertificateGenerator();
// Returns the SingleThreadTaskRunner suitable for running WebRTC networking. // Returns the SingleThreadTaskRunner suitable for running WebRTC networking.
// An rtc::Thread will have already been created. // An rtc::Thread will have already been created.
// May return null if WebRTC functionality is not implemented. // May return null if WebRTC functionality is not implemented.
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_crypto.h" #include "third_party/blink/public/platform/web_crypto.h"
#include "third_party/blink/public/platform/web_crypto_key_algorithm.h" #include "third_party/blink/public/platform/web_crypto_key_algorithm.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/renderer/bindings/modules/v8/serialization/web_crypto_sub_tags.h" #include "third_party/blink/renderer/bindings/modules/v8/serialization/web_crypto_sub_tags.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/modules/crypto/crypto_key.h" #include "third_party/blink/renderer/modules/crypto/crypto_key.h"
#include "third_party/blink/renderer/modules/filesystem/dom_file_system.h" #include "third_party/blink/renderer/modules/filesystem/dom_file_system.h"
#include "third_party/blink/renderer/modules/imagecapture/point_2d.h" #include "third_party/blink/renderer/modules/imagecapture/point_2d.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_certificate.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h"
#include "third_party/blink/renderer/modules/shapedetection/detected_barcode.h" #include "third_party/blink/renderer/modules/shapedetection/detected_barcode.h"
#include "third_party/blink/renderer/modules/shapedetection/detected_face.h" #include "third_party/blink/renderer/modules/shapedetection/detected_face.h"
#include "third_party/blink/renderer/modules/shapedetection/detected_text.h" #include "third_party/blink/renderer/modules/shapedetection/detected_text.h"
...@@ -53,8 +53,8 @@ ScriptWrappable* V8ScriptValueDeserializerForModules::ReadDOMObject( ...@@ -53,8 +53,8 @@ ScriptWrappable* V8ScriptValueDeserializerForModules::ReadDOMObject(
if (!ReadUTF8String(&pem_private_key) || if (!ReadUTF8String(&pem_private_key) ||
!ReadUTF8String(&pem_certificate)) !ReadUTF8String(&pem_certificate))
return nullptr; return nullptr;
std::unique_ptr<WebRTCCertificateGenerator> certificate_generator( std::unique_ptr<RTCCertificateGenerator> certificate_generator =
Platform::Current()->CreateRTCCertificateGenerator()); std::make_unique<RTCCertificateGenerator>();
if (!certificate_generator) if (!certificate_generator)
return nullptr; return nullptr;
rtc::scoped_refptr<rtc::RTCCertificate> certificate = rtc::scoped_refptr<rtc::RTCCertificate> certificate =
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/platform/web_crypto_algorithm_params.h" #include "third_party/blink/public/platform/web_crypto_algorithm_params.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h" #include "third_party/blink/renderer/bindings/core/v8/script_function.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_for_core.h" #include "third_party/blink/renderer/bindings/core/v8/to_v8_for_core.h"
...@@ -30,6 +29,7 @@ ...@@ -30,6 +29,7 @@
#include "third_party/blink/renderer/modules/filesystem/dom_file_system.h" #include "third_party/blink/renderer/modules/filesystem/dom_file_system.h"
#include "third_party/blink/renderer/modules/imagecapture/point_2d.h" #include "third_party/blink/renderer/modules/imagecapture/point_2d.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_certificate.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h"
#include "third_party/blink/renderer/modules/shapedetection/landmark.h" #include "third_party/blink/renderer/modules/shapedetection/landmark.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" #include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
...@@ -155,8 +155,8 @@ static const uint8_t kEcdsaCertificateEncoded[] = { ...@@ -155,8 +155,8 @@ static const uint8_t kEcdsaCertificateEncoded[] = {
TEST(V8ScriptValueSerializerForModulesTest, RoundTripRTCCertificate) { TEST(V8ScriptValueSerializerForModulesTest, RoundTripRTCCertificate) {
// If WebRTC is not supported in this build, this test is meaningless. // If WebRTC is not supported in this build, this test is meaningless.
std::unique_ptr<WebRTCCertificateGenerator> certificate_generator( std::unique_ptr<RTCCertificateGenerator> certificate_generator =
Platform::Current()->CreateRTCCertificateGenerator()); std::make_unique<RTCCertificateGenerator>();
if (!certificate_generator) if (!certificate_generator)
return; return;
...@@ -185,8 +185,8 @@ TEST(V8ScriptValueSerializerForModulesTest, RoundTripRTCCertificate) { ...@@ -185,8 +185,8 @@ TEST(V8ScriptValueSerializerForModulesTest, RoundTripRTCCertificate) {
TEST(V8ScriptValueSerializerForModulesTest, DecodeRTCCertificate) { TEST(V8ScriptValueSerializerForModulesTest, DecodeRTCCertificate) {
// If WebRTC is not supported in this build, this test is meaningless. // If WebRTC is not supported in this build, this test is meaningless.
std::unique_ptr<WebRTCCertificateGenerator> certificate_generator( std::unique_ptr<RTCCertificateGenerator> certificate_generator =
Platform::Current()->CreateRTCCertificateGenerator()); std::make_unique<RTCCertificateGenerator>();
if (!certificate_generator) if (!certificate_generator)
return; return;
......
...@@ -57,6 +57,8 @@ blink_modules_sources("peerconnection") { ...@@ -57,6 +57,8 @@ blink_modules_sources("peerconnection") {
"peer_connection_dependency_factory.cc", "peer_connection_dependency_factory.cc",
"rtc_certificate.cc", "rtc_certificate.cc",
"rtc_certificate.h", "rtc_certificate.h",
"rtc_certificate_generator.cc",
"rtc_certificate_generator.h",
"rtc_data_channel.cc", "rtc_data_channel.cc",
"rtc_data_channel.h", "rtc_data_channel.h",
"rtc_data_channel_event.cc", "rtc_data_channel_event.cc",
......
...@@ -2,24 +2,21 @@ ...@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/renderer/media/webrtc/rtc_certificate_generator.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h"
#include <string> #include <string>
#include <utility> #include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "media/media_buildflags.h"
#include "third_party/blink/public/web/modules/peerconnection/peer_connection_dependency_factory.h" #include "third_party/blink/public/web/modules/peerconnection/peer_connection_dependency_factory.h"
#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h"
#include "third_party/webrtc/api/scoped_refptr.h" #include "third_party/webrtc/api/scoped_refptr.h"
#include "third_party/webrtc/rtc_base/rtc_certificate.h" #include "third_party/webrtc/rtc_base/rtc_certificate.h"
#include "third_party/webrtc/rtc_base/rtc_certificate_generator.h" #include "third_party/webrtc/rtc_base/rtc_certificate_generator.h"
#include "url/gurl.h"
namespace content { namespace blink {
namespace { namespace {
rtc::KeyParams WebRTCKeyParamsToKeyParams( rtc::KeyParams WebRTCKeyParamsToKeyParams(
...@@ -42,13 +39,12 @@ rtc::KeyParams WebRTCKeyParamsToKeyParams( ...@@ -42,13 +39,12 @@ rtc::KeyParams WebRTCKeyParamsToKeyParams(
// is handled by a separate class so that reference counting can keep the // is handled by a separate class so that reference counting can keep the
// request alive independently of the |RTCCertificateGenerator| that spawned it. // request alive independently of the |RTCCertificateGenerator| that spawned it.
class RTCCertificateGeneratorRequest class RTCCertificateGeneratorRequest
: public base::RefCountedThreadSafe<RTCCertificateGeneratorRequest> { : public WTF::ThreadSafeRefCounted<RTCCertificateGeneratorRequest> {
public: public:
RTCCertificateGeneratorRequest( RTCCertificateGeneratorRequest(
const scoped_refptr<base::SingleThreadTaskRunner>& main_thread, const scoped_refptr<base::SingleThreadTaskRunner>& main_thread,
const scoped_refptr<base::SingleThreadTaskRunner>& worker_thread) const scoped_refptr<base::SingleThreadTaskRunner>& worker_thread)
: main_thread_(main_thread), : main_thread_(main_thread), worker_thread_(worker_thread) {
worker_thread_(worker_thread) {
DCHECK(main_thread_); DCHECK(main_thread_);
DCHECK(worker_thread_); DCHECK(worker_thread_);
} }
...@@ -68,7 +64,7 @@ class RTCCertificateGeneratorRequest ...@@ -68,7 +64,7 @@ class RTCCertificateGeneratorRequest
} }
private: private:
friend class base::RefCountedThreadSafe<RTCCertificateGeneratorRequest>; friend class WTF::ThreadSafeRefCounted<RTCCertificateGeneratorRequest>;
~RTCCertificateGeneratorRequest() {} ~RTCCertificateGeneratorRequest() {}
void GenerateCertificateOnWorkerThread( void GenerateCertificateOnWorkerThread(
...@@ -112,7 +108,7 @@ void GenerateCertificateWithOptionalExpiration( ...@@ -112,7 +108,7 @@ void GenerateCertificateWithOptionalExpiration(
pc_dependency_factory->EnsureInitialized(); pc_dependency_factory->EnsureInitialized();
scoped_refptr<RTCCertificateGeneratorRequest> request = scoped_refptr<RTCCertificateGeneratorRequest> request =
new RTCCertificateGeneratorRequest( base::MakeRefCounted<RTCCertificateGeneratorRequest>(
task_runner, pc_dependency_factory->GetWebRtcWorkerThread()); task_runner, pc_dependency_factory->GetWebRtcWorkerThread());
request->GenerateCertificateAsync(key_params, expires_ms, request->GenerateCertificateAsync(key_params, expires_ms,
std::move(completion_callback)); std::move(completion_callback));
...@@ -153,4 +149,4 @@ rtc::scoped_refptr<rtc::RTCCertificate> RTCCertificateGenerator::FromPEM( ...@@ -153,4 +149,4 @@ rtc::scoped_refptr<rtc::RTCCertificate> RTCCertificateGenerator::FromPEM(
return certificate; return certificate;
} }
} // namespace content } // namespace blink
...@@ -2,21 +2,26 @@ ...@@ -2,21 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_CERTIFICATE_GENERATOR_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_CERTIFICATE_GENERATOR_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_CERTIFICATE_GENERATOR_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_CERTIFICATE_GENERATOR_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h" #include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/public/platform/web_rtc_key_params.h" #include "third_party/blink/public/platform/web_rtc_key_params.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/webrtc/api/peer_connection_interface.h" #include "third_party/webrtc/api/peer_connection_interface.h"
namespace content { namespace base {
class SingleThreadTaskRunner;
}
namespace blink {
// Chromium's WebRTCCertificateGenerator implementation; uses the // Chromium's WebRTCCertificateGenerator implementation; uses the
// PeerConnectionIdentityStore/SSLIdentity::Generate to generate the identity, // PeerConnectionIdentityStore/SSLIdentity::Generate to generate the identity,
// rtc::RTCCertificate and content::RTCCertificate. // rtc::RTCCertificate and blink::RTCCertificate.
class RTCCertificateGenerator : public blink::WebRTCCertificateGenerator { class MODULES_EXPORT RTCCertificateGenerator
: public blink::WebRTCCertificateGenerator {
public: public:
RTCCertificateGenerator() {} RTCCertificateGenerator() {}
~RTCCertificateGenerator() override {} ~RTCCertificateGenerator() override {}
...@@ -40,6 +45,6 @@ class RTCCertificateGenerator : public blink::WebRTCCertificateGenerator { ...@@ -40,6 +45,6 @@ class RTCCertificateGenerator : public blink::WebRTCCertificateGenerator {
DISALLOW_COPY_AND_ASSIGN(RTCCertificateGenerator); DISALLOW_COPY_AND_ASSIGN(RTCCertificateGenerator);
}; };
} // namespace content } // namespace blink
#endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_CERTIFICATE_GENERATOR_H_ #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_CERTIFICATE_GENERATOR_H_
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "third_party/blink/public/platform/web_crypto_algorithm_params.h" #include "third_party/blink/public/platform/web_crypto_algorithm_params.h"
#include "third_party/blink/public/platform/web_media_stream.h" #include "third_party/blink/public/platform/web_media_stream.h"
#include "third_party/blink/public/platform/web_rtc_answer_options.h" #include "third_party/blink/public/platform/web_rtc_answer_options.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/public/platform/web_rtc_data_channel_init.h" #include "third_party/blink/public/platform/web_rtc_data_channel_init.h"
#include "third_party/blink/public/platform/web_rtc_ice_candidate.h" #include "third_party/blink/public/platform/web_rtc_ice_candidate.h"
#include "third_party/blink/public/platform/web_rtc_key_params.h" #include "third_party/blink/public/platform/web_rtc_key_params.h"
...@@ -79,6 +78,7 @@ ...@@ -79,6 +78,7 @@
#include "third_party/blink/renderer/modules/mediastream/media_stream_event.h" #include "third_party/blink/renderer/modules/mediastream/media_stream_event.h"
#include "third_party/blink/renderer/modules/mediastream/user_media_controller.h" #include "third_party/blink/renderer/modules/mediastream/user_media_controller.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_answer_options.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_answer_options.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_certificate_generator.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_configuration.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_configuration.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_data_channel.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_data_channel.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_data_channel_event.h" #include "third_party/blink/renderer/modules/peerconnection/rtc_data_channel_event.h"
...@@ -1670,8 +1670,7 @@ ScriptPromise RTCPeerConnection::generateCertificate( ...@@ -1670,8 +1670,7 @@ ScriptPromise RTCPeerConnection::generateCertificate(
} }
DCHECK(key_params.has_value()); DCHECK(key_params.has_value());
std::unique_ptr<WebRTCCertificateGenerator> certificate_generator = auto certificate_generator = std::make_unique<RTCCertificateGenerator>();
Platform::Current()->CreateRTCCertificateGenerator();
// |keyParams| was successfully constructed, but does the certificate // |keyParams| was successfully constructed, but does the certificate
// generator support these parameters? // generator support these parameters?
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h" #include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h" #include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
#include "third_party/blink/public/platform/web_prerendering_support.h" #include "third_party/blink/public/platform/web_prerendering_support.h"
#include "third_party/blink/public/platform/web_rtc_certificate_generator.h"
#include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h" #include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h"
#include "third_party/blink/public/platform/websocket_handshake_throttle.h" #include "third_party/blink/public/platform/websocket_handshake_throttle.h"
#include "third_party/blink/renderer/platform/bindings/parkable_string_manager.h" #include "third_party/blink/renderer/platform/bindings/parkable_string_manager.h"
...@@ -353,11 +352,6 @@ Platform::CreateWebRtcAsyncResolverFactory() { ...@@ -353,11 +352,6 @@ Platform::CreateWebRtcAsyncResolverFactory() {
return nullptr; return nullptr;
} }
std::unique_ptr<WebRTCCertificateGenerator>
Platform::CreateRTCCertificateGenerator() {
return nullptr;
}
std::unique_ptr<webrtc::RtpCapabilities> Platform::GetRtpSenderCapabilities( std::unique_ptr<webrtc::RtpCapabilities> Platform::GetRtpSenderCapabilities(
const WebString& kind) { const WebString& kind) {
return nullptr; return nullptr;
......
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