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

Unified Diff: chromecast/app/cast_main_delegate.cc

Issue 731933005: Chromecast: adds crash handling for Linux build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromecast/chromecast.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/app/cast_main_delegate.cc
diff --git a/chromecast/app/cast_main_delegate.cc b/chromecast/app/cast_main_delegate.cc
index 78e4d55e0c575881d1357270e10ef1d99462b6b6..0f937e5e7d051d2028fcf78f451e509cfdf47630 100644
--- a/chromecast/app/cast_main_delegate.cc
+++ b/chromecast/app/cast_main_delegate.cc
@@ -4,8 +4,11 @@
#include "chromecast/app/cast_main_delegate.h"
+#include <string>
+
#include "base/command_line.h"
#include "base/cpu.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/posix/global_descriptors.h"
@@ -13,7 +16,9 @@
#include "chromecast/common/cast_paths.h"
#include "chromecast/common/cast_resource_delegate.h"
#include "chromecast/common/global_descriptors.h"
+#include "chromecast/crash/cast_crash_reporter_client.h"
#include "chromecast/renderer/cast_content_renderer_client.h"
+#include "components/crash/app/crash_reporter_client.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
@@ -22,6 +27,15 @@
#include "chromecast/crash/android/crash_handler.h"
#endif // defined(OS_ANDROID)
+namespace {
+
+#if !defined(OS_ANDROID)
+base::LazyInstance<chromecast::CastCrashReporterClient>::Leaky
+ g_crash_reporter_client = LAZY_INSTANCE_INITIALIZER;
+#endif // !defined(OS_ANDROID)
+
+} // namespace
+
namespace chromecast {
namespace shell {
@@ -69,6 +83,12 @@ void CastMainDelegate::PreSandboxStartup() {
base::FilePath log_file;
PathService::Get(FILE_CAST_ANDROID_LOG, &log_file);
chromecast::CrashHandler::Initialize(process_type, log_file);
+#else
+ crash_reporter::SetCrashReporterClient(g_crash_reporter_client.Pointer());
+
+ if (process_type != switches::kZygoteProcess) {
+ CastCrashReporterClient::InitCrashReporter(process_type);
+ }
#endif // defined(OS_ANDROID)
InitializeResourceBundle();
@@ -92,6 +112,10 @@ int CastMainDelegate::RunProcess(
#if !defined(OS_ANDROID)
void CastMainDelegate::ZygoteForked() {
+ const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
+ std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+ CastCrashReporterClient::InitCrashReporter(process_type);
}
#endif // !defined(OS_ANDROID)
« no previous file with comments | « no previous file | chromecast/chromecast.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698