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

Side by Side Diff: android_webview/lib/main/aw_main_delegate.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: Finalized, RFC 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/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 6
7 #include "android_webview/browser/aw_content_browser_client.h" 7 #include "android_webview/browser/aw_content_browser_client.h"
8 #include "android_webview/browser/browser_view_renderer.h" 8 #include "android_webview/browser/browser_view_renderer.h"
9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" 9 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h"
10 #include "android_webview/common/aw_descriptors.h" 10 #include "android_webview/common/aw_descriptors.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 #if defined(ARCH_CPU_ARM_FAMILY) 150 #if defined(ARCH_CPU_ARM_FAMILY)
151 // Create an instance of the CPU class to parse /proc/cpuinfo and cache 151 // Create an instance of the CPU class to parse /proc/cpuinfo and cache
152 // cpu_brand info. 152 // cpu_brand info.
153 base::CPU cpu_info; 153 base::CPU cpu_info;
154 #endif 154 #endif
155 155
156 const base::CommandLine& command_line = 156 const base::CommandLine& command_line =
157 *base::CommandLine::ForCurrentProcess(); 157 *base::CommandLine::ForCurrentProcess();
158 std::string process_type = 158 std::string process_type =
159 command_line.GetSwitchValueASCII(switches::kProcessType); 159 command_line.GetSwitchValueASCII(switches::kProcessType);
160 int crash_signal_fd = -1;
160 if (process_type == switches::kRendererProcess) { 161 if (process_type == switches::kRendererProcess) {
161 auto global_descriptors = base::GlobalDescriptors::GetInstance(); 162 auto global_descriptors = base::GlobalDescriptors::GetInstance();
162 int pak_fd = global_descriptors->Get(kAndroidWebViewLocalePakDescriptor); 163 int pak_fd = global_descriptors->Get(kAndroidWebViewLocalePakDescriptor);
163 base::MemoryMappedFile::Region pak_region = 164 base::MemoryMappedFile::Region pak_region =
164 global_descriptors->GetRegion(kAndroidWebViewLocalePakDescriptor); 165 global_descriptors->GetRegion(kAndroidWebViewLocalePakDescriptor);
165 ResourceBundle::InitSharedInstanceWithPakFileRegion(base::File(pak_fd), 166 ResourceBundle::InitSharedInstanceWithPakFileRegion(base::File(pak_fd),
166 pak_region); 167 pak_region);
167 pak_fd = global_descriptors->Get(kAndroidWebViewMainPakDescriptor); 168 pak_fd = global_descriptors->Get(kAndroidWebViewMainPakDescriptor);
168 pak_region = 169 pak_region =
169 global_descriptors->GetRegion(kAndroidWebViewMainPakDescriptor); 170 global_descriptors->GetRegion(kAndroidWebViewMainPakDescriptor);
170 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( 171 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
171 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_NONE); 172 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_NONE);
173 crash_signal_fd =
174 global_descriptors->Get(kAndroidWebViewCrashSignalDescriptor);
172 } 175 }
173 if (process_type.empty() && 176 if (process_type.empty() &&
174 command_line.HasSwitch(switches::kSingleProcess)) { 177 command_line.HasSwitch(switches::kSingleProcess)) {
175 // "webview" has a special treatment in breakpad_linux.cc. 178 // "webview" has a special treatment in breakpad_linux.cc.
176 process_type = "webview"; 179 process_type = "webview";
177 } 180 }
178 181
179 crash_reporter::EnableMicrodumpCrashReporter(process_type); 182 crash_reporter::EnableMicrodumpCrashReporter(process_type, crash_signal_fd);
180 } 183 }
181 184
182 int AwMainDelegate::RunProcess( 185 int AwMainDelegate::RunProcess(
183 const std::string& process_type, 186 const std::string& process_type,
184 const content::MainFunctionParams& main_function_params) { 187 const content::MainFunctionParams& main_function_params) {
185 if (process_type.empty()) { 188 if (process_type.empty()) {
186 AwBrowserDependencyFactoryImpl::InstallInstance(); 189 AwBrowserDependencyFactoryImpl::InstallInstance();
187 190
188 browser_runner_.reset(content::BrowserMainRunner::Create()); 191 browser_runner_.reset(content::BrowserMainRunner::Create());
189 int exit_code = browser_runner_->Initialize(main_function_params); 192 int exit_code = browser_runner_->Initialize(main_function_params);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 #if defined(VIDEO_HOLE) 252 #if defined(VIDEO_HOLE)
250 content::ExternalVideoSurfaceContainer* 253 content::ExternalVideoSurfaceContainer*
251 AwMainDelegate::CreateExternalVideoSurfaceContainer( 254 AwMainDelegate::CreateExternalVideoSurfaceContainer(
252 content::WebContents* web_contents) { 255 content::WebContents* web_contents) {
253 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create( 256 return external_video_surface::ExternalVideoSurfaceContainerImpl::Create(
254 web_contents); 257 web_contents);
255 } 258 }
256 #endif 259 #endif
257 260
258 } // namespace android_webview 261 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698