| OLD | NEW |
| 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/lib/aw_browser_dependency_factory_impl.h" | 10 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
| 11 #include "android_webview/native/aw_media_url_interceptor.h" | 11 #include "android_webview/native/aw_media_url_interceptor.h" |
| 12 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 12 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
| 13 #include "android_webview/native/aw_web_contents_view_delegate.h" | 13 #include "android_webview/native/aw_web_contents_view_delegate.h" |
| 14 #include "android_webview/native/aw_web_preferences_populater_impl.h" | 14 #include "android_webview/native/aw_web_preferences_populater_impl.h" |
| 15 #include "android_webview/native/external_video_surface_container_impl.h" | 15 #include "android_webview/native/external_video_surface_container_impl.h" |
| 16 #include "android_webview/renderer/aw_content_renderer_client.h" | 16 #include "android_webview/renderer/aw_content_renderer_client.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/cpu.h" | 18 #include "base/cpu.h" |
| 19 #include "base/lazy_instance.h" | 19 #include "base/lazy_instance.h" |
| 20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
| 22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
| 23 #include "cc/base/switches.h" | |
| 24 #include "content/browser/media/android/browser_media_player_manager.h" | 23 #include "content/browser/media/android/browser_media_player_manager.h" |
| 25 #include "content/public/browser/browser_main_runner.h" | 24 #include "content/public/browser/browser_main_runner.h" |
| 26 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
| 28 #include "gpu/command_buffer/client/gl_in_process_context.h" | 27 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 29 #include "gpu/command_buffer/service/gpu_switches.h" | 28 #include "gpu/command_buffer/service/gpu_switches.h" |
| 30 #include "media/base/media_switches.h" | 29 #include "media/base/media_switches.h" |
| 31 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 30 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
| 32 | 31 |
| 33 namespace android_webview { | 32 namespace android_webview { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #if defined(VIDEO_HOLE) | 76 #if defined(VIDEO_HOLE) |
| 78 // Support EME/L1 with hole-punching. | 77 // Support EME/L1 with hole-punching. |
| 79 cl->AppendSwitch(switches::kMediaDrmEnableNonCompositing); | 78 cl->AppendSwitch(switches::kMediaDrmEnableNonCompositing); |
| 80 #endif | 79 #endif |
| 81 | 80 |
| 82 // WebRTC hardware decoding is not supported, internal bug 15075307 | 81 // WebRTC hardware decoding is not supported, internal bug 15075307 |
| 83 cl->AppendSwitch(switches::kDisableWebRtcHWDecoding); | 82 cl->AppendSwitch(switches::kDisableWebRtcHWDecoding); |
| 84 | 83 |
| 85 // This is needed for sharing textures across the different GL threads. | 84 // This is needed for sharing textures across the different GL threads. |
| 86 cl->AppendSwitch(switches::kEnableThreadedTextureMailboxes); | 85 cl->AppendSwitch(switches::kEnableThreadedTextureMailboxes); |
| 87 | |
| 88 // Virtual viewport doesn't behave well with web view. crbug.com/426891 | |
| 89 cl->AppendSwitch(cc::switches::kDisablePinchVirtualViewport); | |
| 90 | |
| 91 return false; | 86 return false; |
| 92 } | 87 } |
| 93 | 88 |
| 94 void AwMainDelegate::PreSandboxStartup() { | 89 void AwMainDelegate::PreSandboxStartup() { |
| 95 // TODO(torne): When we have a separate renderer process, we need to handle | 90 // TODO(torne): When we have a separate renderer process, we need to handle |
| 96 // being passed open FDs for the resource paks here. | 91 // being passed open FDs for the resource paks here. |
| 97 #if defined(ARCH_CPU_ARM_FAMILY) | 92 #if defined(ARCH_CPU_ARM_FAMILY) |
| 98 // Create an instance of the CPU class to parse /proc/cpuinfo and cache | 93 // Create an instance of the CPU class to parse /proc/cpuinfo and cache |
| 99 // cpu_brand info. | 94 // cpu_brand info. |
| 100 base::CPU cpu_info; | 95 base::CPU cpu_info; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 155 |
| 161 #if defined(VIDEO_HOLE) | 156 #if defined(VIDEO_HOLE) |
| 162 content::ExternalVideoSurfaceContainer* | 157 content::ExternalVideoSurfaceContainer* |
| 163 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 158 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
| 164 content::WebContents* web_contents) { | 159 content::WebContents* web_contents) { |
| 165 return new ExternalVideoSurfaceContainerImpl(web_contents); | 160 return new ExternalVideoSurfaceContainerImpl(web_contents); |
| 166 } | 161 } |
| 167 #endif | 162 #endif |
| 168 | 163 |
| 169 } // namespace android_webview | 164 } // namespace android_webview |
| OLD | NEW |