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/gpu_memory_buffer_factory_impl.h" | 8 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" |
9 #include "android_webview/browser/hardware_renderer.h" | 9 #include "android_webview/browser/hardware_renderer.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_geolocation_permission_context.h" | 12 #include "android_webview/native/aw_geolocation_permission_context.h" |
13 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 13 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
14 #include "android_webview/native/aw_web_contents_view_delegate.h" | 14 #include "android_webview/native/aw_web_contents_view_delegate.h" |
15 #include "android_webview/native/aw_web_preferences_populater_impl.h" | 15 #include "android_webview/native/aw_web_preferences_populater_impl.h" |
16 #include "android_webview/native/external_video_surface_container_impl.h" | 16 #include "android_webview/native/external_video_surface_container_impl.h" |
17 #include "android_webview/renderer/aw_content_renderer_client.h" | 17 #include "android_webview/renderer/aw_content_renderer_client.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.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" |
23 #include "content/public/browser/browser_main_runner.h" | 24 #include "content/public/browser/browser_main_runner.h" |
24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
25 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
26 #include "gpu/command_buffer/client/gl_in_process_context.h" | 27 #include "gpu/command_buffer/client/gl_in_process_context.h" |
27 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 28 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
28 #include "media/base/media_switches.h" | 29 #include "media/base/media_switches.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #if defined(VIDEO_HOLE) | 77 #if defined(VIDEO_HOLE) |
77 // Support EME/L1 with hole-punching. | 78 // Support EME/L1 with hole-punching. |
78 cl->AppendSwitch(switches::kMediaDrmEnableNonCompositing); | 79 cl->AppendSwitch(switches::kMediaDrmEnableNonCompositing); |
79 #endif | 80 #endif |
80 return false; | 81 return false; |
81 } | 82 } |
82 | 83 |
83 void AwMainDelegate::PreSandboxStartup() { | 84 void AwMainDelegate::PreSandboxStartup() { |
84 // TODO(torne): When we have a separate renderer process, we need to handle | 85 // TODO(torne): When we have a separate renderer process, we need to handle |
85 // being passed open FDs for the resource paks here. | 86 // being passed open FDs for the resource paks here. |
| 87 #if defined(ARCH_CPU_ARM_FAMILY) |
| 88 // Create an instance of the CPU class to parse /proc/cpuinfo and cache |
| 89 // cpu_brand info. |
| 90 base::CPU cpu_info; |
| 91 #endif |
86 } | 92 } |
87 | 93 |
88 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { | 94 void AwMainDelegate::SandboxInitialized(const std::string& process_type) { |
89 // TODO(torne): Adjust linux OOM score here. | 95 // TODO(torne): Adjust linux OOM score here. |
90 } | 96 } |
91 | 97 |
92 int AwMainDelegate::RunProcess( | 98 int AwMainDelegate::RunProcess( |
93 const std::string& process_type, | 99 const std::string& process_type, |
94 const content::MainFunctionParams& main_function_params) { | 100 const content::MainFunctionParams& main_function_params) { |
95 if (process_type.empty()) { | 101 if (process_type.empty()) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 156 |
151 #if defined(VIDEO_HOLE) | 157 #if defined(VIDEO_HOLE) |
152 content::ExternalVideoSurfaceContainer* | 158 content::ExternalVideoSurfaceContainer* |
153 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 159 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
154 content::WebContents* web_contents) { | 160 content::WebContents* web_contents) { |
155 return new ExternalVideoSurfaceContainerImpl(web_contents); | 161 return new ExternalVideoSurfaceContainerImpl(web_contents); |
156 } | 162 } |
157 #endif | 163 #endif |
158 | 164 |
159 } // namespace android_webview | 165 } // namespace android_webview |
OLD | NEW |