| 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/gpu_memory_buffer_factory_impl.h" | 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" |
| 10 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | 10 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
| 11 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" | 11 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
| 12 #include "android_webview/native/aw_media_url_interceptor.h" |
| 12 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 13 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
| 13 #include "android_webview/native/aw_web_contents_view_delegate.h" | 14 #include "android_webview/native/aw_web_contents_view_delegate.h" |
| 14 #include "android_webview/native/aw_web_preferences_populater_impl.h" | 15 #include "android_webview/native/aw_web_preferences_populater_impl.h" |
| 15 #include "android_webview/native/external_video_surface_container_impl.h" | 16 #include "android_webview/native/external_video_surface_container_impl.h" |
| 16 #include "android_webview/renderer/aw_content_renderer_client.h" | 17 #include "android_webview/renderer/aw_content_renderer_client.h" |
| 17 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 18 #include "base/cpu.h" | 19 #include "base/cpu.h" |
| 19 #include "base/lazy_instance.h" | 20 #include "base/lazy_instance.h" |
| 20 #include "base/logging.h" | 21 #include "base/logging.h" |
| 21 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
| 22 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "content/browser/media/android/browser_media_player_manager.h" |
| 23 #include "content/public/browser/browser_main_runner.h" | 25 #include "content/public/browser/browser_main_runner.h" |
| 24 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 26 #include "gpu/command_buffer/client/gl_in_process_context.h" | 28 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 27 #include "media/base/media_switches.h" | 29 #include "media/base/media_switches.h" |
| 28 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 30 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
| 29 | 31 |
| 30 namespace android_webview { | 32 namespace android_webview { |
| 31 | 33 |
| 32 namespace { | 34 namespace { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 52 bool zero_copy_disabled_by_switch = cl->HasSwitch(switches::kDisableZeroCopy); | 54 bool zero_copy_disabled_by_switch = cl->HasSwitch(switches::kDisableZeroCopy); |
| 53 bool use_zero_copy = !zero_copy_disabled_by_switch && | 55 bool use_zero_copy = !zero_copy_disabled_by_switch && |
| 54 gpu_memory_buffer_factory_.get()->Initialize(); | 56 gpu_memory_buffer_factory_.get()->Initialize(); |
| 55 | 57 |
| 56 if (use_zero_copy) { | 58 if (use_zero_copy) { |
| 57 cl->AppendSwitch(switches::kEnableZeroCopy); | 59 cl->AppendSwitch(switches::kEnableZeroCopy); |
| 58 } else if (!zero_copy_disabled_by_switch) { | 60 } else if (!zero_copy_disabled_by_switch) { |
| 59 cl->AppendSwitch(switches::kDisableZeroCopy); | 61 cl->AppendSwitch(switches::kDisableZeroCopy); |
| 60 } | 62 } |
| 61 | 63 |
| 64 content::BrowserMediaPlayerManager::RegisterMediaUrlInterceptor( |
| 65 new AwMediaUrlInterceptor()); |
| 66 |
| 62 BrowserViewRenderer::CalculateTileMemoryPolicy(use_zero_copy); | 67 BrowserViewRenderer::CalculateTileMemoryPolicy(use_zero_copy); |
| 63 | 68 |
| 64 cl->AppendSwitch(switches::kEnableBeginFrameScheduling); | 69 cl->AppendSwitch(switches::kEnableBeginFrameScheduling); |
| 65 cl->AppendSwitch(switches::kEnableImplSidePainting); | 70 cl->AppendSwitch(switches::kEnableImplSidePainting); |
| 66 | 71 |
| 67 // WebView uses the Android system's scrollbars and overscroll glow. | 72 // WebView uses the Android system's scrollbars and overscroll glow. |
| 68 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); | 73 cl->AppendSwitch(switches::kDisableOverscrollEdgeEffect); |
| 69 | 74 |
| 70 // Not yet supported in single-process mode. | 75 // Not yet supported in single-process mode. |
| 71 cl->AppendSwitch(switches::kDisableSharedWorkers); | 76 cl->AppendSwitch(switches::kDisableSharedWorkers); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 158 |
| 154 #if defined(VIDEO_HOLE) | 159 #if defined(VIDEO_HOLE) |
| 155 content::ExternalVideoSurfaceContainer* | 160 content::ExternalVideoSurfaceContainer* |
| 156 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 161 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
| 157 content::WebContents* web_contents) { | 162 content::WebContents* web_contents) { |
| 158 return new ExternalVideoSurfaceContainerImpl(web_contents); | 163 return new ExternalVideoSurfaceContainerImpl(web_contents); |
| 159 } | 164 } |
| 160 #endif | 165 #endif |
| 161 | 166 |
| 162 } // namespace android_webview | 167 } // namespace android_webview |
| OLD | NEW |