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

Side by Side Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 1824143004: Allow WebView to force MediaPlayer for unsupported containers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 6
7 #include "android_webview/browser/aw_content_browser_client.h" 7 #include "android_webview/browser/aw_content_browser_client.h"
8 #include "android_webview/browser/browser_view_renderer.h" 8 #include "android_webview/browser/browser_view_renderer.h"
9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" 9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
10 #include "android_webview/common/aw_descriptors.h" 10 #include "android_webview/common/aw_descriptors.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 kV8SnapshotDataDescriptor64, 133 kV8SnapshotDataDescriptor64,
134 gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe()); 134 gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe());
135 } 135 }
136 136
137 if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) { 137 if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) {
138 cl->AppendSwitch(switches::kInProcessGPU); 138 cl->AppendSwitch(switches::kInProcessGPU);
139 cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); 139 cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1");
140 cl->AppendSwitch(switches::kDisableRendererBackgrounding); 140 cl->AppendSwitch(switches::kDisableRendererBackgrounding);
141 } 141 }
142 142
143 // Android WebView needs to support codecs that Chrome does not, for these
144 // cases we must force the usage of Android MediaPlayer instead of Chrome's
145 // internal player. Format list mirrors:
146 // http://developer.android.com/guide/appendix/media-formats.html
147 cl->AppendSwitchASCII(switches::kUseMediaPlayerForExtensions,
148 ".3gp,.ts,.flac,.mid,.xmf,.mxmf,.rtttl,.rtx,.ota,.imy");
149
143 return false; 150 return false;
144 } 151 }
145 152
146 void AwMainDelegate::PreSandboxStartup() { 153 void AwMainDelegate::PreSandboxStartup() {
147 #if defined(ARCH_CPU_ARM_FAMILY) 154 #if defined(ARCH_CPU_ARM_FAMILY)
148 // Create an instance of the CPU class to parse /proc/cpuinfo and cache 155 // Create an instance of the CPU class to parse /proc/cpuinfo and cache
149 // cpu_brand info. 156 // cpu_brand info.
150 base::CPU cpu_info; 157 base::CPU cpu_info;
151 #endif 158 #endif
152 159
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 #if defined(VIDEO_HOLE) 256 #if defined(VIDEO_HOLE)
250 content::ExternalVideoSurfaceContainer* 257 content::ExternalVideoSurfaceContainer*
251 AwMainDelegate::CreateExternalVideoSurfaceContainer( 258 AwMainDelegate::CreateExternalVideoSurfaceContainer(
252 content::WebContents* web_contents) { 259 content::WebContents* web_contents) {
253 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( 260 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create(
254 web_contents); 261 web_contents);
255 } 262 }
256 #endif 263 #endif
257 264
258 } // namespace android_webview 265 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698