| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_content_browser_client.h" | 9 #include "android_webview/browser/aw_content_browser_client.h" |
| 10 #include "android_webview/browser/browser_view_renderer.h" | 10 #include "android_webview/browser/browser_view_renderer.h" |
| 11 #include "android_webview/browser/command_line_helper.h" |
| 11 #include "android_webview/browser/deferred_gpu_command_service.h" | 12 #include "android_webview/browser/deferred_gpu_command_service.h" |
| 12 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | 13 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
| 13 #include "android_webview/common/aw_descriptors.h" | 14 #include "android_webview/common/aw_descriptors.h" |
| 14 #include "android_webview/common/aw_switches.h" | 15 #include "android_webview/common/aw_switches.h" |
| 15 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h" | 16 #include "android_webview/crash_reporter/aw_microdump_crash_reporter.h" |
| 16 #include "android_webview/gpu/aw_content_gpu_client.h" | 17 #include "android_webview/gpu/aw_content_gpu_client.h" |
| 17 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" | 18 #include "android_webview/lib/aw_browser_dependency_factory_impl.h" |
| 18 #include "android_webview/native/aw_locale_manager_impl.h" | 19 #include "android_webview/native/aw_locale_manager_impl.h" |
| 19 #include "android_webview/native/aw_media_url_interceptor.h" | 20 #include "android_webview/native/aw_media_url_interceptor.h" |
| 20 #include "android_webview/native/aw_message_port_service_impl.h" | 21 #include "android_webview/native/aw_message_port_service_impl.h" |
| 21 #include "android_webview/native/aw_quota_manager_bridge_impl.h" | 22 #include "android_webview/native/aw_quota_manager_bridge_impl.h" |
| 22 #include "android_webview/native/aw_web_contents_view_delegate.h" | 23 #include "android_webview/native/aw_web_contents_view_delegate.h" |
| 23 #include "android_webview/native/aw_web_preferences_populater_impl.h" | 24 #include "android_webview/native/aw_web_preferences_populater_impl.h" |
| 24 #include "android_webview/renderer/aw_content_renderer_client.h" | 25 #include "android_webview/renderer/aw_content_renderer_client.h" |
| 25 #include "base/android/apk_assets.h" | 26 #include "base/android/apk_assets.h" |
| 26 #include "base/command_line.h" | 27 #include "base/command_line.h" |
| 27 #include "base/cpu.h" | 28 #include "base/cpu.h" |
| 28 #include "base/i18n/icu_util.h" | 29 #include "base/i18n/icu_util.h" |
| 29 #include "base/lazy_instance.h" | 30 #include "base/lazy_instance.h" |
| 30 #include "base/logging.h" | 31 #include "base/logging.h" |
| 31 #include "base/threading/thread_restrictions.h" | 32 #include "base/threading/thread_restrictions.h" |
| 32 #include "cc/base/switches.h" | 33 #include "cc/base/switches.h" |
| 33 #include "components/crash/content/app/breakpad_linux.h" | 34 #include "components/crash/content/app/breakpad_linux.h" |
| 35 #include "components/spellcheck/common/spellcheck_features.h" |
| 34 #include "content/public/browser/android/browser_media_player_manager_register.h
" | 36 #include "content/public/browser/android/browser_media_player_manager_register.h
" |
| 35 #include "content/public/browser/browser_main_runner.h" | 37 #include "content/public/browser/browser_main_runner.h" |
| 36 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/common/content_descriptors.h" | 39 #include "content/public/common/content_descriptors.h" |
| 38 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
| 39 #include "gin/public/isolate_holder.h" | 41 #include "gin/public/isolate_holder.h" |
| 40 #include "gin/v8_initializer.h" | 42 #include "gin/v8_initializer.h" |
| 41 #include "gpu/command_buffer/client/gl_in_process_context.h" | 43 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 42 #include "gpu/command_buffer/service/gpu_switches.h" | 44 #include "gpu/command_buffer/service/gpu_switches.h" |
| 43 #include "media/base/media_switches.h" | 45 #include "media/base/media_switches.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe()); | 132 gin::V8Initializer::GetSnapshotFilePath(false).AsUTF8Unsafe()); |
| 131 } | 133 } |
| 132 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 134 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 133 | 135 |
| 134 if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) { | 136 if (cl->HasSwitch(switches::kWebViewSandboxedRenderer)) { |
| 135 cl->AppendSwitch(switches::kInProcessGPU); | 137 cl->AppendSwitch(switches::kInProcessGPU); |
| 136 cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); | 138 cl->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); |
| 137 cl->AppendSwitch(switches::kDisableRendererBackgrounding); | 139 cl->AppendSwitch(switches::kDisableRendererBackgrounding); |
| 138 } | 140 } |
| 139 | 141 |
| 142 CommandLineHelper::AddEnabledFeature( |
| 143 *cl, spellcheck::kAndroidSpellCheckerNonLowEnd.name); |
| 144 |
| 140 return false; | 145 return false; |
| 141 } | 146 } |
| 142 | 147 |
| 143 void AwMainDelegate::PreSandboxStartup() { | 148 void AwMainDelegate::PreSandboxStartup() { |
| 144 #if defined(ARCH_CPU_ARM_FAMILY) | 149 #if defined(ARCH_CPU_ARM_FAMILY) |
| 145 // Create an instance of the CPU class to parse /proc/cpuinfo and cache | 150 // Create an instance of the CPU class to parse /proc/cpuinfo and cache |
| 146 // cpu_brand info. | 151 // cpu_brand info. |
| 147 base::CPU cpu_info; | 152 base::CPU cpu_info; |
| 148 #endif | 153 #endif |
| 149 | 154 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 257 |
| 253 AwMessagePortService* AwMainDelegate::CreateAwMessagePortService() { | 258 AwMessagePortService* AwMainDelegate::CreateAwMessagePortService() { |
| 254 return new AwMessagePortServiceImpl(); | 259 return new AwMessagePortServiceImpl(); |
| 255 } | 260 } |
| 256 | 261 |
| 257 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() { | 262 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() { |
| 258 return new AwLocaleManagerImpl(); | 263 return new AwLocaleManagerImpl(); |
| 259 } | 264 } |
| 260 | 265 |
| 261 } // namespace android_webview | 266 } // namespace android_webview |
| OLD | NEW |