Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1425)

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1373023002: RTCCertificate, RTCPeerConnection.generateCertificate (WebRTC JavaScript) added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits + Pass webkit_tests (updated global-interface-listing-expected.txt) Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/renderer_blink_platform_impl.cc
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 9da0779e3e3309e6ce6441910692dfea95ee39d8..b5633818854858845a8a25e6cdc0a3c1ff057bff 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -60,6 +60,7 @@
#include "content/renderer/media/media_recorder_handler.h"
#include "content/renderer/media/renderer_webaudiodevice_impl.h"
#include "content/renderer/media/renderer_webmidiaccessor_impl.h"
+#include "content/renderer/media/rtc_certificate_generator.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/renderer_clipboard_delegate.h"
#include "content/renderer/screen_orientation/screen_orientation_observer.h"
@@ -318,7 +319,7 @@ blink::WebFileUtilities* RendererBlinkPlatformImpl::fileUtilities() {
blink::WebSandboxSupport* RendererBlinkPlatformImpl::sandboxSupport() {
#if defined(OS_ANDROID) || defined(OS_WIN)
// These platforms do not require sandbox support.
- return NULL;
+ return nullptr;
#else
return sandbox_support_.get();
#endif
@@ -326,7 +327,7 @@ blink::WebSandboxSupport* RendererBlinkPlatformImpl::sandboxSupport() {
blink::WebCookieJar* RendererBlinkPlatformImpl::cookieJar() {
NOTREACHED() << "Use WebFrameClient::cookieJar() instead!";
- return NULL;
+ return nullptr;
}
blink::WebThemeEngine* RendererBlinkPlatformImpl::themeEngine() {
@@ -404,7 +405,7 @@ void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) {
}
RenderThread* thread = RenderThread::Get();
- if (thread) // NULL in unittests.
+ if (thread) // nullptr in unittests.
thread->Send(new RenderProcessHostMsg_SuddenTerminationChanged(enabled));
}
@@ -565,7 +566,7 @@ bool RendererBlinkPlatformImpl::SandboxSupport::loadFont(NSFont* src_font,
base::SharedMemoryHandle font_data;
if (!RenderThread::Get()->Send(new RenderProcessHostMsg_LoadFont(
src_font_descriptor, &font_data_size, &font_data, font_id))) {
- *out = NULL;
+ *out = nullptr;
*font_id = 0;
return false;
}
@@ -574,7 +575,7 @@ bool RendererBlinkPlatformImpl::SandboxSupport::loadFont(NSFont* src_font,
*font_id == 0) {
LOG(ERROR) << "Bad response from RenderProcessHostMsg_LoadFont() for " <<
src_font_descriptor.font_name;
- *out = NULL;
+ *out = nullptr;
jochen (gone - plz use gerrit) 2015/10/20 12:27:35 please don't change code unrelated to your CL
hbos_chromium 2015/10/20 15:42:23 Acknowledged. Changed back to old NULL usage.
*font_id = 0;
return false;
}
@@ -670,7 +671,7 @@ bool RendererBlinkPlatformImpl::canAccelerate2dCanvas() {
bool RendererBlinkPlatformImpl::isThreadedCompositingEnabled() {
RenderThreadImpl* thread = RenderThreadImpl::current();
- // thread can be NULL in tests.
+ // thread can be nullptr in tests.
return thread && thread->compositor_task_runner().get();
}
@@ -875,7 +876,7 @@ blink::WebScrollbarBehavior* RendererBlinkPlatformImpl::scrollbarBehavior() {
//------------------------------------------------------------------------------
WebBlobRegistry* RendererBlinkPlatformImpl::blobRegistry() {
- // blob_registry_ can be NULL when running some tests.
+ // blob_registry_ can be nullptr when running some tests.
return blob_registry_.get();
}
@@ -908,7 +909,7 @@ RendererBlinkPlatformImpl::createRTCPeerConnectionHandler(
RenderThreadImpl* render_thread = RenderThreadImpl::current();
DCHECK(render_thread);
if (!render_thread)
- return NULL;
+ return nullptr;
#if defined(ENABLE_WEBRTC)
WebRTCPeerConnectionHandler* peer_connection_handler =
@@ -921,7 +922,18 @@ RendererBlinkPlatformImpl::createRTCPeerConnectionHandler(
render_thread->GetPeerConnectionDependencyFactory();
return rtc_dependency_factory->CreateRTCPeerConnectionHandler(client);
#else
- return NULL;
+ return nullptr;
+#endif // defined(ENABLE_WEBRTC)
+}
+
+//------------------------------------------------------------------------------
+
+blink::WebRTCCertificateGenerator*
+RendererBlinkPlatformImpl::createRTCCertificateGenerator() {
+#if defined(ENABLE_WEBRTC)
+ return new RTCCertificateGenerator();
+#else
+ return nullptr;
#endif // defined(ENABLE_WEBRTC)
}
@@ -932,7 +944,7 @@ WebMediaStreamCenter* RendererBlinkPlatformImpl::createMediaStreamCenter(
RenderThreadImpl* render_thread = RenderThreadImpl::current();
DCHECK(render_thread);
if (!render_thread)
- return NULL;
+ return nullptr;
return render_thread->CreateMediaStreamCenter(client);
}
@@ -966,14 +978,14 @@ bool RendererBlinkPlatformImpl::processMemorySizesInBytes(
blink::WebGraphicsContext3D*
RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes) {
- return createOffscreenGraphicsContext3D(attributes, NULL);
+ return createOffscreenGraphicsContext3D(attributes, nullptr);
}
blink::WebGraphicsContext3D*
RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes,
blink::WebGraphicsContext3D* share_context) {
- return createOffscreenGraphicsContext3D(attributes, share_context, NULL);
+ return createOffscreenGraphicsContext3D(attributes, share_context, nullptr);
}
blink::WebGraphicsContext3D*
@@ -982,7 +994,7 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
blink::WebGraphicsContext3D* share_context,
blink::WebGLInfo* gl_info) {
if (!RenderThreadImpl::current())
- return NULL;
+ return nullptr;
scoped_refptr<GpuChannelHost> gpu_channel_host(
RenderThreadImpl::current()->EstablishGpuChannelSync(
@@ -1027,7 +1039,7 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
// Most likely the GPU process exited and the attempt to reconnect to it
// failed. Need to try to restore the context again later.
if (!context || !context->InitializeOnCurrentThread())
- return NULL;
+ return nullptr;
return context.release();
}
@@ -1038,7 +1050,7 @@ RendererBlinkPlatformImpl::createSharedOffscreenGraphicsContext3DProvider() {
scoped_refptr<cc_blink::ContextProviderWebContext> provider =
RenderThreadImpl::current()->SharedMainThreadContextProvider();
if (!provider.get())
- return NULL;
+ return nullptr;
return new WebGraphicsContext3DProviderImpl(provider);
}
@@ -1125,7 +1137,7 @@ RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType(
// hardware changes. In order to make that happen, they will receive a null
// thread.
if (thread && RenderThreadImpl::current()->layout_test_mode())
- thread = NULL;
+ thread = nullptr;
switch (type) {
case blink::WebPlatformEventDeviceMotion:
@@ -1145,7 +1157,7 @@ RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType(
"unknown type.";
}
- return NULL;
+ return nullptr;
}
void RendererBlinkPlatformImpl::SetPlatformEventObserverForTesting(

Powered by Google App Engine
This is Rietveld 408576698