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

Unified Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 893303002: Chromecast Android: fix for 100% crash when child process is launched. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates commit msg Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_browser_main_parts.cc
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc
index e7bcbc9e175289a0d4e0d4050a80efa30784241c..263d5955bc5ea28f18f848930de16a088aa990dc 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -168,12 +168,21 @@ void CastBrowserMainParts::PostMainMessageLoopStart() {
}
int CastBrowserMainParts::PreCreateThreads() {
-#if !defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+ // GPU process is started immediately after threads are created, requiring
+ // CrashDumpManager to be initialized beforehand.
+ base::FilePath crash_dumps_dir;
+ if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) {
+ LOG(ERROR) << "Could not find crash dump location.";
+ }
+ cast_browser_process_->SetCrashDumpManager(
+ make_scoped_ptr(new breakpad::CrashDumpManager(crash_dumps_dir)));
+#else
base::FilePath home_dir;
CHECK(PathService::Get(DIR_CAST_HOME, &home_dir));
if (!base::CreateDirectory(home_dir))
return 1;
-#endif // !defined(OS_ANDROID)
+#endif
return 0;
}
@@ -199,15 +208,6 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
cast_browser_process_->pref_service(),
cast_browser_process_->browser_context()->GetRequestContext()));
-#if defined(OS_ANDROID)
- base::FilePath crash_dumps_dir;
- if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) {
- LOG(ERROR) << "Could not find crash dump location.";
- }
- cast_browser_process_->SetCrashDumpManager(
- make_scoped_ptr(new breakpad::CrashDumpManager(crash_dumps_dir)));
-#endif
-
if (!PlatformClientAuth::Initialize())
LOG(ERROR) << "PlatformClientAuth::Initialize failed.";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698