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

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

Issue 1525023003: Distinguish in the browser between renderer crashes and kills (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented detection of a volunatry renderer exit Created 5 years 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_dev_tools_discovery_provider.h" 8 #include "android_webview/browser/aw_dev_tools_discovery_provider.h"
9 #include "android_webview/browser/aw_media_client_android.h" 9 #include "android_webview/browser/aw_media_client_android.h"
10 #include "android_webview/browser/aw_result_codes.h" 10 #include "android_webview/browser/aw_result_codes.h"
11 #include "android_webview/browser/deferred_gpu_command_service.h" 11 #include "android_webview/browser/deferred_gpu_command_service.h"
12 #include "android_webview/common/aw_resource.h" 12 #include "android_webview/common/aw_resource.h"
13 #include "android_webview/common/aw_switches.h" 13 #include "android_webview/common/aw_switches.h"
14 #include "base/android/apk_assets.h" 14 #include "base/android/apk_assets.h"
15 #include "base/android/build_info.h" 15 #include "base/android/build_info.h"
16 #include "base/android/locale_utils.h" 16 #include "base/android/locale_utils.h"
17 #include "base/android/memory_pressure_listener_android.h" 17 #include "base/android/memory_pressure_listener_android.h"
18 #include "base/command_line.h" 18 #include "base/command_line.h"
19 #include "base/files/file_path.h" 19 #include "base/files/file_path.h"
20 #include "base/path_service.h" 20 #include "base/path_service.h"
21 #include "components/crash/content/browser/crash_micro_dump_manager_android.h"
21 #include "content/public/browser/android/synchronous_compositor.h" 22 #include "content/public/browser/android/synchronous_compositor.h"
22 #include "content/public/browser/render_frame_host.h" 23 #include "content/public/browser/render_frame_host.h"
23 #include "content/public/browser/render_process_host.h" 24 #include "content/public/browser/render_process_host.h"
24 #include "content/public/common/content_client.h" 25 #include "content/public/common/content_client.h"
25 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
26 #include "content/public/common/result_codes.h" 27 #include "content/public/common/result_codes.h"
27 #include "media/base/android/media_client_android.h" 28 #include "media/base/android/media_client_android.h"
28 #include "net/android/network_change_notifier_factory_android.h" 29 #include "net/android/network_change_notifier_factory_android.h"
29 #include "net/base/network_change_notifier.h" 30 #include "net/base/network_change_notifier.h"
30 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Try to directly mmap the webviewchromium.pak from the apk. Fall back to 69 // Try to directly mmap the webviewchromium.pak from the apk. Fall back to
69 // load from file, using PATH_SERVICE, otherwise. 70 // load from file, using PATH_SERVICE, otherwise.
70 base::FilePath pak_file_path; 71 base::FilePath pak_file_path;
71 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path); 72 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_file_path);
72 pak_file_path = pak_file_path.AppendASCII("webviewchromium.pak"); 73 pak_file_path = pak_file_path.AppendASCII("webviewchromium.pak");
73 ui::LoadMainAndroidPackFile("assets/webviewchromium.pak", pak_file_path); 74 ui::LoadMainAndroidPackFile("assets/webviewchromium.pak", pak_file_path);
74 75
75 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback( 76 base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(
76 base::android::AttachCurrentThread()); 77 base::android::AttachCurrentThread());
77 DeferredGpuCommandService::SetInstance(); 78 DeferredGpuCommandService::SetInstance();
79 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
80 switches::kSingleProcess)) {
81 crash_micro_dump_manager_.reset(new breakpad::CrashMicroDumpManager());
82 }
78 83
79 return content::RESULT_CODE_NORMAL_EXIT; 84 return content::RESULT_CODE_NORMAL_EXIT;
80 } 85 }
81 86
82 void AwBrowserMainParts::PreMainMessageLoopRun() { 87 void AwBrowserMainParts::PreMainMessageLoopRun() {
83 browser_context_->PreMainMessageLoopRun(); 88 browser_context_->PreMainMessageLoopRun();
84 89
85 AwDevToolsDiscoveryProvider::Install(); 90 AwDevToolsDiscoveryProvider::Install();
86 91
87 media::SetMediaClientAndroid( 92 media::SetMediaClientAndroid(
88 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping())); 93 new AwMediaClientAndroid(AwResource::GetConfigKeySystemUuidMapping()));
89 94
90 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); 95 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView();
91 } 96 }
92 97
93 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { 98 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) {
94 // Android WebView does not use default MessageLoop. It has its own 99 // Android WebView does not use default MessageLoop. It has its own
95 // Android specific MessageLoop. 100 // Android specific MessageLoop.
96 return true; 101 return true;
97 } 102 }
98 103
99 } // namespace android_webview 104 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698