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

Side by Side Diff: android_webview/browser/aw_browser_main_parts.cc

Issue 2200693002: Refactor CrashDump*Manager to use a shared CrashDumpObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 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/browser/aw_browser_main_parts.h" 5 #include "android_webview/browser/aw_browser_main_parts.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_terminator.h"
8 #include "android_webview/browser/aw_content_browser_client.h" 9 #include "android_webview/browser/aw_content_browser_client.h"
9 #include "android_webview/browser/aw_result_codes.h" 10 #include "android_webview/browser/aw_result_codes.h"
10 #include "android_webview/browser/deferred_gpu_command_service.h" 11 #include "android_webview/browser/deferred_gpu_command_service.h"
11 #include "android_webview/browser/net/aw_network_change_notifier_factory.h" 12 #include "android_webview/browser/net/aw_network_change_notifier_factory.h"
12 #include "android_webview/common/aw_resource.h" 13 #include "android_webview/common/aw_resource.h"
13 #include "android_webview/common/aw_switches.h" 14 #include "android_webview/common/aw_switches.h"
14 #include "base/android/apk_assets.h" 15 #include "base/android/apk_assets.h"
15 #include "base/android/build_info.h" 16 #include "base/android/build_info.h"
16 #include "base/android/locale_utils.h" 17 #include "base/android/locale_utils.h"
17 #include "base/android/memory_pressure_listener_android.h" 18 #include "base/android/memory_pressure_listener_android.h"
18 #include "base/command_line.h" 19 #include "base/command_line.h"
19 #include "base/files/file_path.h" 20 #include "base/files/file_path.h"
20 #include "base/i18n/rtl.h" 21 #include "base/i18n/rtl.h"
21 #include "base/path_service.h" 22 #include "base/path_service.h"
22 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" 23 #include "components/crash/content/browser/crash_dump_observer_android.h"
23 #include "content/public/browser/android/synchronous_compositor.h" 24 #include "content/public/browser/android/synchronous_compositor.h"
24 #include "content/public/browser/render_frame_host.h" 25 #include "content/public/browser/render_frame_host.h"
25 #include "content/public/browser/render_process_host.h" 26 #include "content/public/browser/render_process_host.h"
26 #include "content/public/common/content_client.h" 27 #include "content/public/common/content_client.h"
27 #include "content/public/common/content_switches.h" 28 #include "content/public/common/content_switches.h"
28 #include "content/public/common/result_codes.h" 29 #include "content/public/common/result_codes.h"
29 #include "device/geolocation/access_token_store.h" 30 #include "device/geolocation/access_token_store.h"
30 #include "device/geolocation/geolocation_delegate.h" 31 #include "device/geolocation/geolocation_delegate.h"
31 #include "device/geolocation/geolocation_provider.h" 32 #include "device/geolocation/geolocation_provider.h"
32 #include "net/android/network_change_notifier_factory_android.h" 33 #include "net/android/network_change_notifier_factory_android.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Try to directly mmap the resources.pak from the apk. Fall back to load 109 // Try to directly mmap the resources.pak from the apk. Fall back to load
109 // from file, using PATH_SERVICE, otherwise. 110 // from file, using PATH_SERVICE, otherwise.
110 base::FilePath pak_file_path; 111 base::FilePath pak_file_path;
111 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path); 112 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path);
112 pak_file_path = pak_file_path.AppendASCII("resources.pak"); 113 pak_file_path = pak_file_path.AppendASCII("resources.pak");
113 ui::LoadMainAndroidPackFile("assets/resources.pak", pak_file_path); 114 ui::LoadMainAndroidPackFile("assets/resources.pak", pak_file_path);
114 115
115 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( 116 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(
116 base::android::AttachCurrentThread()); 117 base::android::AttachCurrentThread());
117 DeferredGpuCommandService::SetInstance(); 118 DeferredGpuCommandService::SetInstance();
119 crash_dump_observer_ = base::MakeUnique<breakpad::CrashDumpObserver>();
118 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 120 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
119 switches::kSingleProcess)) { 121 switches::kSingleProcess)) {
120 // Create the renderers crash manager on the UI thread. 122 // Create the renderers crash manager on the UI thread.
121 breakpad::CrashMicroDumpManager::GetInstance(); 123 crash_dump_observer_->RegisterClient(new AwBrowserTerminator());
122 } 124 }
123 125
124 return content::RESULT_CODE_NORMAL_EXIT; 126 return content::RESULT_CODE_NORMAL_EXIT;
125 } 127 }
126 128
127 void AwBrowserMainParts::PreMainMessageLoopRun() { 129 void AwBrowserMainParts::PreMainMessageLoopRun() {
128 browser_client_->InitBrowserContext()->PreMainMessageLoopRun(); 130 browser_client_->InitBrowserContext()->PreMainMessageLoopRun();
129 131
130 device::GeolocationProvider::SetGeolocationDelegate( 132 device::GeolocationProvider::SetGeolocationDelegate(
131 new AwGeolocationDelegate()); 133 new AwGeolocationDelegate());
132 134
133 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); 135 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView();
134 } 136 }
135 137
136 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { 138 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) {
137 // Android WebView does not use default MessageLoop. It has its own 139 // Android WebView does not use default MessageLoop. It has its own
138 // Android specific MessageLoop. 140 // Android specific MessageLoop.
139 return true; 141 return true;
140 } 142 }
141 143
142 } // namespace android_webview 144 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_main_parts.h ('k') | android_webview/browser/aw_browser_terminator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698