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

Unified Diff: chromecast/shell/browser/cast_content_browser_client.cc

Issue 620673003: Chromecast: adds crash handling for Android build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address lei's comments Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/shell/browser/cast_browser_process.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/shell/browser/cast_content_browser_client.cc
diff --git a/chromecast/shell/browser/cast_content_browser_client.cc b/chromecast/shell/browser/cast_content_browser_client.cc
index 546aa809b8c84bfc2102eb4f27454f877e1a67fb..ad1ea3f23d6720e9c3f47905e8be4d9fab15eec9 100644
--- a/chromecast/shell/browser/cast_content_browser_client.cc
+++ b/chromecast/shell/browser/cast_content_browser_client.cc
@@ -17,6 +17,7 @@
#include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h"
#include "chromecast/shell/browser/geolocation/cast_access_token_store.h"
#include "chromecast/shell/browser/url_request_context_factory.h"
+#include "components/crash/app/breakpad_linux.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/certificate_request_result_type.h"
#include "content/public/browser/render_process_host.h"
@@ -30,6 +31,10 @@
#include "chromecast/shell/browser/android/external_video_surface_container_impl.h"
#endif // defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+#include "components/crash/browser/crash_dump_manager_android.h"
+#endif // defined(OS_ANDROID)
+
namespace chromecast {
namespace shell {
@@ -228,6 +233,19 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
mappings->Transfer(
kAndroidPakDescriptor,
base::ScopedFD(pak_with_flags.TakePlatformFile()));
+
+ if (breakpad::IsCrashReporterEnabled()) {
+ base::File minidump_file(
+ breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
+ child_process_id));
+ if (!minidump_file.IsValid()) {
+ LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
+ << "be disabled for this process.";
+ } else {
+ mappings->Transfer(kAndroidMinidumpDescriptor,
+ base::ScopedFD(minidump_file.TakePlatformFile()));
+ }
+ }
#endif // defined(OS_ANDROID)
}
« no previous file with comments | « chromecast/shell/browser/cast_browser_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698