Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: android_webview/lib/main/aw_main_delegate.cc

Issue 2812703003: aw: Remove global AllowWait on UI thread (Closed)
Patch Set: future Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/aw_safe_browsing_config_helper.h" 10 #include "android_webview/browser/aw_safe_browsing_config_helper.h"
11 #include "android_webview/browser/browser_view_renderer.h" 11 #include "android_webview/browser/browser_view_renderer.h"
12 #include "android_webview/browser/command_line_helper.h" 12 #include "android_webview/browser/command_line_helper.h"
13 #include "android_webview/browser/deferred_gpu_command_service.h" 13 #include "android_webview/browser/deferred_gpu_command_service.h"
14 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
15 #include "android_webview/common/aw_descriptors.h" 14 #include "android_webview/common/aw_descriptors.h"
16 #include "android_webview/common/aw_paths.h" 15 #include "android_webview/common/aw_paths.h"
17 #include "android_webview/common/aw_switches.h" 16 #include "android_webview/common/aw_switches.h"
18 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h" 17 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h"
19 #include "android_webview/common/crash_reporter/crash_keys.h" 18 #include "android_webview/common/crash_reporter/crash_keys.h"
20 #include "android_webview/gpu/aw_content_gpu_client.h" 19 #include "android_webview/gpu/aw_content_gpu_client.h"
21 #include "android_webview/native/aw_locale_manager_impl.h" 20 #include "android_webview/native/aw_locale_manager_impl.h"
22 #include "android_webview/native/aw_media_url_interceptor.h" 21 #include "android_webview/native/aw_media_url_interceptor.h"
23 #include "android_webview/native/aw_quota_manager_bridge_impl.h" 22 #include "android_webview/native/aw_quota_manager_bridge_impl.h"
24 #include "android_webview/native/aw_web_contents_view_delegate.h" 23 #include "android_webview/native/aw_web_contents_view_delegate.h"
(...skipping 23 matching lines...) Expand all
48 #include "gin/v8_initializer.h" 47 #include "gin/v8_initializer.h"
49 #include "gpu/command_buffer/service/gpu_switches.h" 48 #include "gpu/command_buffer/service/gpu_switches.h"
50 #include "gpu/ipc/gl_in_process_context.h" 49 #include "gpu/ipc/gl_in_process_context.h"
51 #include "media/base/media_switches.h" 50 #include "media/base/media_switches.h"
52 #include "media/media_features.h" 51 #include "media/media_features.h"
53 #include "ui/base/resource/resource_bundle.h" 52 #include "ui/base/resource/resource_bundle.h"
54 #include "ui/events/gesture_detection/gesture_configuration.h" 53 #include "ui/events/gesture_detection/gesture_configuration.h"
55 54
56 namespace android_webview { 55 namespace android_webview {
57 56
58 namespace {
59
60 // TODO(boliu): Remove this global Allow once the underlying issues are
61 // resolved - http://crbug.com/240453. See AwMainDelegate::RunProcess below.
62 base::LazyInstance<std::unique_ptr<ScopedAllowWaitForLegacyWebViewApi>>::
63 DestructorAtExit g_allow_wait_in_ui_thread = LAZY_INSTANCE_INITIALIZER;
64 }
65
66 AwMainDelegate::AwMainDelegate() { 57 AwMainDelegate::AwMainDelegate() {
67 } 58 }
68 59
69 AwMainDelegate::~AwMainDelegate() { 60 AwMainDelegate::~AwMainDelegate() {
70 } 61 }
71 62
72 bool AwMainDelegate::BasicStartupComplete(int* exit_code) { 63 bool AwMainDelegate::BasicStartupComplete(int* exit_code) {
73 content::SetContentClient(&content_client_); 64 content::SetContentClient(&content_client_);
74 65
75 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); 66 base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 browser_runner_.reset(content::BrowserMainRunner::Create()); 224 browser_runner_.reset(content::BrowserMainRunner::Create());
234 int exit_code = browser_runner_->Initialize(main_function_params); 225 int exit_code = browser_runner_->Initialize(main_function_params);
235 DCHECK_LT(exit_code, 0); 226 DCHECK_LT(exit_code, 0);
236 227
237 // At this point the content client has received the GPU info required 228 // At this point the content client has received the GPU info required
238 // to create a GPU fingerpring, and we can pass it to the microdump 229 // to create a GPU fingerpring, and we can pass it to the microdump
239 // crash handler on the same thread as the crash handler was initialized. 230 // crash handler on the same thread as the crash handler was initialized.
240 crash_reporter::AddGpuFingerprintToMicrodumpCrashHandler( 231 crash_reporter::AddGpuFingerprintToMicrodumpCrashHandler(
241 content_client_.gpu_fingerprint()); 232 content_client_.gpu_fingerprint());
242 233
243 g_allow_wait_in_ui_thread.Get().reset(
244 new ScopedAllowWaitForLegacyWebViewApi);
245
246 // Return 0 so that we do NOT trigger the default behavior. On Android, the 234 // Return 0 so that we do NOT trigger the default behavior. On Android, the
247 // UI message loop is managed by the Java application. 235 // UI message loop is managed by the Java application.
248 return 0; 236 return 0;
249 } 237 }
250 238
251 return -1; 239 return -1;
252 } 240 }
253 241
254 void AwMainDelegate::ProcessExiting(const std::string& process_type) { 242 void AwMainDelegate::ProcessExiting(const std::string& process_type) {
255 // TODO(torne): Clean up resources when we handle them. 243 // TODO(torne): Clean up resources when we handle them.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 282
295 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() { 283 AwWebPreferencesPopulater* AwMainDelegate::CreateWebPreferencesPopulater() {
296 return new AwWebPreferencesPopulaterImpl(); 284 return new AwWebPreferencesPopulaterImpl();
297 } 285 }
298 286
299 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() { 287 AwLocaleManager* AwMainDelegate::CreateAwLocaleManager() {
300 return new AwLocaleManagerImpl(); 288 return new AwLocaleManagerImpl();
301 } 289 }
302 290
303 } // namespace android_webview 291 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h ('k') | android_webview/native/cookie_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698