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

Unified Diff: content/renderer/render_view_impl.cc

Issue 53313005: Respect disable_webrtc command line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index db2fd0ecb12416a42d6bb52f066b3bd69b81520f..1ab404f50b1bb58e4d204f680e68d498e8142f76 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3068,23 +3068,26 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer(
WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) {
FOR_EACH_OBSERVER(
RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client));
-
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
#if defined(ENABLE_WEBRTC)
- if (!InitializeMediaStreamClient())
- return NULL;
-
+ bool webrtc_enabled = !cmd_line->HasSwitch(switches::kDisableWebRTC);
+ if (webrtc_enabled) {
jamesr 2013/10/30 22:45:20 early return would be better if (cmd_line->HasSwi
michaelbai 2013/10/30 22:48:35 We can't return and still want to create WebMediaP
jamesr 2013/10/30 22:50:11 This function's way too complicated. Break it up i
michaelbai 2013/10/30 23:13:30 Agreed, I had another CL https://codereview.chromi
+ if (!InitializeMediaStreamClient()) {
+ LOG(ERROR) << "Failed to initialize MediaStreamClient";
+ return NULL;
+ }
#if !defined(GOOGLE_TV)
- if (media_stream_client_->IsMediaStream(url)) {
+ if (media_stream_client_->IsMediaStream(url)) {
#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
- bool found_neon =
- (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
- UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon);
+ bool found_neon =
+ (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
+ UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon);
#endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
- return new WebMediaPlayerMS(
- frame, client, AsWeakPtr(), media_stream_client_, new RenderMediaLog());
- }
+ return new WebMediaPlayerMS(frame, client, AsWeakPtr(),
+ media_stream_client_, new RenderMediaLog());
+ }
#endif // !defined(GOOGLE_TV)
+ }
#endif // defined(ENABLE_WEBRTC)
#if defined(OS_ANDROID)
@@ -3130,7 +3133,7 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer(
RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(),
new RenderMediaLog()));
#if defined(ENABLE_WEBRTC) && defined(GOOGLE_TV)
- if (media_stream_client_->IsMediaStream(url)) {
+ if (webrtc_enabled && media_stream_client_->IsMediaStream(url)) {
RTCVideoDecoderFactoryTv* factory = RenderThreadImpl::current()
->GetMediaStreamDependencyFactory()->decoder_factory_tv();
// |media_stream_client| and |factory| outlives |web_media_player_android|.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698