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

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: style nits Created 6 years, 3 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
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 b2e6db72af12fa8e7784fdccda9ede301214840c..61c7a8e54adf0471eaabfd7b0f11ef957fc78ab5 100644
--- a/chromecast/shell/browser/cast_content_browser_client.cc
+++ b/chromecast/shell/browser/cast_content_browser_client.cc
@@ -15,6 +15,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/file_descriptor_info.h"
@@ -24,6 +25,10 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
+#if defined(OS_ANDROID)
+#include "components/crash/browser/crash_dump_manager_android.h"
+#endif // defined(OS_ANDROID)
+
namespace chromecast {
namespace shell {
@@ -174,6 +179,20 @@ void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
mappings->push_back(content::FileDescriptorInfo(
kAndroidPakDescriptor,
base::FileDescriptor(base::File(pak_file, flags))));
+
+ 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->push_back(content::FileDescriptorInfo(
+ kAndroidMinidumpDescriptor,
+ base::FileDescriptor(base::File(pak_file, flags))));
+ }
+ }
#endif // defined(OS_ANDROID)
}

Powered by Google App Engine
This is Rietveld 408576698