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

Side by Side Diff: content/shell/browser/shell_content_browser_client.cc

Issue 2393853002: Refactor CrashDump*Manager to use a shared CrashDumpObserver singleton. (Closed)
Patch Set: fix initialization in ShellBrowserMainParts 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 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 const base::CommandLine& command_line, 320 const base::CommandLine& command_line,
321 int child_process_id, 321 int child_process_id,
322 content::FileDescriptorInfo* mappings, 322 content::FileDescriptorInfo* mappings,
323 std::map<int, base::MemoryMappedFile::Region>* regions) { 323 std::map<int, base::MemoryMappedFile::Region>* regions) {
324 mappings->Share( 324 mappings->Share(
325 kShellPakDescriptor, 325 kShellPakDescriptor,
326 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); 326 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor));
327 regions->insert(std::make_pair( 327 regions->insert(std::make_pair(
328 kShellPakDescriptor, 328 kShellPakDescriptor,
329 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); 329 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor)));
330 330 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted(
331 if (breakpad::IsCrashReporterEnabled()) { 331 child_process_id, mappings);
332 base::File f(breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
333 child_process_id));
334 if (!f.IsValid()) {
335 LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
336 << "be disabled for this process.";
337 } else {
338 mappings->Transfer(kAndroidMinidumpDescriptor,
339 base::ScopedFD(f.TakePlatformFile()));
340 }
341 }
342 } 332 }
343 #elif defined(OS_POSIX) && !defined(OS_MACOSX) 333 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
344 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 334 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
345 const base::CommandLine& command_line, 335 const base::CommandLine& command_line,
346 int child_process_id, 336 int child_process_id,
347 content::FileDescriptorInfo* mappings) { 337 content::FileDescriptorInfo* mappings) {
348 int crash_signal_fd = GetCrashSignalFD(command_line); 338 int crash_signal_fd = GetCrashSignalFD(command_line);
349 if (crash_signal_fd >= 0) { 339 if (crash_signal_fd >= 0) {
350 mappings->Share(kCrashDumpSignal, crash_signal_fd); 340 mappings->Share(kCrashDumpSignal, crash_signal_fd);
351 } 341 }
(...skipping 20 matching lines...) Expand all
372 ShellBrowserContext* ShellContentBrowserClient::browser_context() { 362 ShellBrowserContext* ShellContentBrowserClient::browser_context() {
373 return shell_browser_main_parts_->browser_context(); 363 return shell_browser_main_parts_->browser_context();
374 } 364 }
375 365
376 ShellBrowserContext* 366 ShellBrowserContext*
377 ShellContentBrowserClient::off_the_record_browser_context() { 367 ShellContentBrowserClient::off_the_record_browser_context() {
378 return shell_browser_main_parts_->off_the_record_browser_context(); 368 return shell_browser_main_parts_->off_the_record_browser_context();
379 } 369 }
380 370
381 } // namespace content 371 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698