Chromium Code Reviews| 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" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 #include "gpu/command_buffer/client/gl_in_process_context.h" | 41 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 42 #include "gpu/command_buffer/service/gpu_switches.h" | 42 #include "gpu/command_buffer/service/gpu_switches.h" |
| 43 #include "media/base/media_switches.h" | 43 #include "media/base/media_switches.h" |
| 44 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
| 45 #include "ui/events/gesture_detection/gesture_configuration.h" | 45 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 46 | 46 |
| 47 namespace android_webview { | 47 namespace android_webview { |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| 51 const char kWebViewSingleProcessType[] = "webview-singleprocess"; | |
|
Torne
2016/06/25 14:05:16
These seem really long; bikeshedding a bit, but it
hush (inactive)
2016/06/27 22:15:26
The problem with just "webview-browser" is only un
| |
| 52 const char kWebViewBrowserProcessType[] = "webview-multiprocess-browser"; | |
| 53 const char kWebViewRendererProcessType[] = "webview-multiprocess-renderer"; | |
| 54 | |
| 51 // TODO(boliu): Remove this global Allow once the underlying issues are | 55 // TODO(boliu): Remove this global Allow once the underlying issues are |
| 52 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. | 56 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below. |
| 53 base::LazyInstance<std::unique_ptr<ScopedAllowWaitForLegacyWebViewApi>> | 57 base::LazyInstance<std::unique_ptr<ScopedAllowWaitForLegacyWebViewApi>> |
| 54 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; | 58 g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER; |
| 55 } | 59 } |
| 56 | 60 |
| 57 AwMainDelegate::AwMainDelegate() { | 61 AwMainDelegate::AwMainDelegate() { |
| 58 } | 62 } |
| 59 | 63 |
| 60 AwMainDelegate::~AwMainDelegate() { | 64 AwMainDelegate::~AwMainDelegate() { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 global_descriptors->GetRegion(kAndroidWebViewLocalePakDescriptor); | 166 global_descriptors->GetRegion(kAndroidWebViewLocalePakDescriptor); |
| 163 ResourceBundle::InitSharedInstanceWithPakFileRegion(base::File(pak_fd), | 167 ResourceBundle::InitSharedInstanceWithPakFileRegion(base::File(pak_fd), |
| 164 pak_region); | 168 pak_region); |
| 165 pak_fd = global_descriptors->Get(kAndroidWebViewMainPakDescriptor); | 169 pak_fd = global_descriptors->Get(kAndroidWebViewMainPakDescriptor); |
| 166 pak_region = | 170 pak_region = |
| 167 global_descriptors->GetRegion(kAndroidWebViewMainPakDescriptor); | 171 global_descriptors->GetRegion(kAndroidWebViewMainPakDescriptor); |
| 168 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( | 172 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( |
| 169 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_NONE); | 173 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_NONE); |
| 170 crash_signal_fd = | 174 crash_signal_fd = |
| 171 global_descriptors->Get(kAndroidWebViewCrashSignalDescriptor); | 175 global_descriptors->Get(kAndroidWebViewCrashSignalDescriptor); |
| 176 process_type = kWebViewRendererProcessType; | |
|
Torne
2016/06/25 14:05:16
Having a couple of hardcoded cases where we change
hush (inactive)
2016/06/27 22:15:26
Just prepending "webview-" to process_type does no
| |
| 172 } | 177 } |
| 173 if (process_type.empty() && | 178 if (process_type.empty()) { |
| 174 command_line.HasSwitch(switches::kSingleProcess)) { | 179 if (command_line.HasSwitch(switches::kSingleProcess)) { |
| 175 // "webview" has a special treatment in breakpad_linux.cc. | 180 process_type = kWebViewSingleProcessType; |
| 176 process_type = "webview"; | 181 } else { |
| 182 process_type = kWebViewBrowserProcessType; | |
| 183 } | |
| 177 } | 184 } |
| 178 | 185 |
| 179 crash_reporter::EnableMicrodumpCrashReporter(process_type, crash_signal_fd); | 186 crash_reporter::EnableMicrodumpCrashReporter(process_type, crash_signal_fd); |
| 180 } | 187 } |
| 181 | 188 |
| 182 int AwMainDelegate::RunProcess( | 189 int AwMainDelegate::RunProcess( |
| 183 const std::string& process_type, | 190 const std::string& process_type, |
| 184 const content::MainFunctionParams& main_function_params) { | 191 const content::MainFunctionParams& main_function_params) { |
| 185 if (process_type.empty()) { | 192 if (process_type.empty()) { |
| 186 AwBrowserDependencyFactoryImpl::InstallInstance(); | 193 AwBrowserDependencyFactoryImpl::InstallInstance(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 #if defined(VIDEO_HOLE) | 269 #if defined(VIDEO_HOLE) |
| 263 content::ExternalVideoSurfaceContainer* | 270 content::ExternalVideoSurfaceContainer* |
| 264 AwMainDelegate::CreateExternalVideoSurfaceContainer( | 271 AwMainDelegate::CreateExternalVideoSurfaceContainer( |
| 265 content::WebContents* web_contents) { | 272 content::WebContents* web_contents) { |
| 266 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( | 273 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( |
| 267 web_contents); | 274 web_contents); |
| 268 } | 275 } |
| 269 #endif | 276 #endif |
| 270 | 277 |
| 271 } // namespace android_webview | 278 } // namespace android_webview |
| OLD | NEW |