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

Side by Side Diff: chromecast/browser/cast_content_browser_client.cc

Issue 2393853002: Refactor CrashDump*Manager to use a shared CrashDumpObserver singleton. (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « chromecast/browser/cast_browser_process.cc ('k') | components/crash/content/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/browser/cast_content_browser_client.h" 5 #include "chromecast/browser/cast_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 462 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
463 const base::CommandLine& command_line, 463 const base::CommandLine& command_line,
464 int child_process_id, 464 int child_process_id,
465 content::FileDescriptorInfo* mappings) { 465 content::FileDescriptorInfo* mappings) {
466 #if defined(OS_ANDROID) 466 #if defined(OS_ANDROID)
467 mappings->ShareWithRegion( 467 mappings->ShareWithRegion(
468 kAndroidPakDescriptor, 468 kAndroidPakDescriptor,
469 base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor), 469 base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor),
470 base::GlobalDescriptors::GetInstance()->GetRegion(kAndroidPakDescriptor)); 470 base::GlobalDescriptors::GetInstance()->GetRegion(kAndroidPakDescriptor));
471 471 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted(
472 if (breakpad::IsCrashReporterEnabled()) { 472 child_process_id, mappings);
473 base::File minidump_file(
474 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
475 child_process_id));
476 if (!minidump_file.IsValid()) {
477 LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
478 << "be disabled for this process.";
479 } else {
480 mappings->Transfer(kAndroidMinidumpDescriptor,
481 base::ScopedFD(minidump_file.TakePlatformFile()));
482 }
483 }
484 #else 473 #else
485 int crash_signal_fd = GetCrashSignalFD(command_line); 474 int crash_signal_fd = GetCrashSignalFD(command_line);
486 if (crash_signal_fd >= 0) { 475 if (crash_signal_fd >= 0) {
487 mappings->Share(kCrashDumpSignal, crash_signal_fd); 476 mappings->Share(kCrashDumpSignal, crash_signal_fd);
488 } 477 }
489 #endif // defined(OS_ANDROID) 478 #endif // defined(OS_ANDROID)
490 } 479 }
491 480
492 void CastContentBrowserClient::GetAdditionalWebUISchemes( 481 void CastContentBrowserClient::GetAdditionalWebUISchemes(
493 std::vector<std::string>* additional_schemes) { 482 std::vector<std::string>* additional_schemes) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 process_type, dumps_path, false /* upload */); 523 process_type, dumps_path, false /* upload */);
535 // StartUploaderThread() even though upload is diferred. 524 // StartUploaderThread() even though upload is diferred.
536 // Breakpad-related memory is freed in the uploader thread. 525 // Breakpad-related memory is freed in the uploader thread.
537 crash_handler->StartUploaderThread(); 526 crash_handler->StartUploaderThread();
538 return crash_handler; 527 return crash_handler;
539 } 528 }
540 #endif // !defined(OS_ANDROID) 529 #endif // !defined(OS_ANDROID)
541 530
542 } // namespace shell 531 } // namespace shell
543 } // namespace chromecast 532 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_browser_process.cc ('k') | components/crash/content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698