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

Side by Side Diff: content/shell/browser/shell_content_browser_client.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
« no previous file with comments | « content/shell/browser/shell_browser_main_parts.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_content_browser_client.h" 5 #include "content/shell/browser/shell_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 const base::CommandLine& command_line, 297 const base::CommandLine& command_line,
298 int child_process_id, 298 int child_process_id,
299 content::FileDescriptorInfo* mappings, 299 content::FileDescriptorInfo* mappings,
300 std::map<int, base::MemoryMappedFile::Region>* regions) { 300 std::map<int, base::MemoryMappedFile::Region>* regions) {
301 mappings->Share( 301 mappings->Share(
302 kShellPakDescriptor, 302 kShellPakDescriptor,
303 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); 303 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor));
304 regions->insert(std::make_pair( 304 regions->insert(std::make_pair(
305 kShellPakDescriptor, 305 kShellPakDescriptor,
306 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); 306 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor)));
307 307 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted(
308 if (breakpad::IsCrashReporterEnabled()) { 308 child_process_id, mappings);
309 base::File f(breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
310 child_process_id));
311 if (!f.IsValid()) {
312 LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
313 << "be disabled for this process.";
314 } else {
315 mappings->Transfer(kAndroidMinidumpDescriptor,
316 base::ScopedFD(f.TakePlatformFile()));
317 }
318 }
319 } 309 }
320 #elif defined(OS_POSIX) && !defined(OS_MACOSX) 310 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
321 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 311 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
322 const base::CommandLine& command_line, 312 const base::CommandLine& command_line,
323 int child_process_id, 313 int child_process_id,
324 content::FileDescriptorInfo* mappings) { 314 content::FileDescriptorInfo* mappings) {
325 int crash_signal_fd = GetCrashSignalFD(command_line); 315 int crash_signal_fd = GetCrashSignalFD(command_line);
326 if (crash_signal_fd >= 0) { 316 if (crash_signal_fd >= 0) {
327 mappings->Share(kCrashDumpSignal, crash_signal_fd); 317 mappings->Share(kCrashDumpSignal, crash_signal_fd);
328 } 318 }
(...skipping 20 matching lines...) Expand all
349 ShellBrowserContext* ShellContentBrowserClient::browser_context() { 339 ShellBrowserContext* ShellContentBrowserClient::browser_context() {
350 return shell_browser_main_parts_->browser_context(); 340 return shell_browser_main_parts_->browser_context();
351 } 341 }
352 342
353 ShellBrowserContext* 343 ShellBrowserContext*
354 ShellContentBrowserClient::off_the_record_browser_context() { 344 ShellContentBrowserClient::off_the_record_browser_context() {
355 return shell_browser_main_parts_->off_the_record_browser_context(); 345 return shell_browser_main_parts_->off_the_record_browser_context();
356 } 346 }
357 347
358 } // namespace content 348 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_main_parts.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698