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

Unified Diff: components/crash/content/browser/crash_dump_manager_android.cc

Issue 2878193002: [Crash Reporting] Implement a more direct bridge for extracting logcat output. (Closed)
Patch Set: Document threading more, and fix check_deps Created 3 years, 7 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 | « components/crash/content/browser/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/crash/content/browser/crash_dump_manager_android.cc
diff --git a/components/crash/content/browser/crash_dump_manager_android.cc b/components/crash/content/browser/crash_dump_manager_android.cc
index bec13bdd5f4a1143fad9b806e3815b728890fc84..c7b7628c239801afdff7c88bab5f1441a5f8c69c 100644
--- a/components/crash/content/browser/crash_dump_manager_android.cc
+++ b/components/crash/content/browser/crash_dump_manager_android.cc
@@ -6,6 +6,8 @@
#include <stdint.h>
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
@@ -23,6 +25,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
+#include "jni/CrashDumpManager_jni.h"
using content::BrowserThread;
@@ -153,8 +156,15 @@ void CrashDumpManager::ProcessMinidump(
base::DeleteFile(minidump_path, false);
return;
}
- VLOG(1) << "Crash minidump successfully generated: "
- << crash_dump_dir.Append(filename).value();
+ VLOG(1) << "Crash minidump successfully generated: " << dest_path.value();
+
+ // Hop over to Java to attempt to attach the logcat to the crash. This may
+ // fail, which is ok -- if it does, the crash will still be uploaded on the
+ // next browser start.
+ JNIEnv* env = base::android::AttachCurrentThread();
+ base::android::ScopedJavaLocalRef<jstring> j_dest_path =
+ base::android::ConvertUTF8ToJavaString(env, dest_path.value());
+ Java_CrashDumpManager_tryToUploadMinidump(env, j_dest_path);
}
void CrashDumpManager::OnChildExit(int child_process_id,
« no previous file with comments | « components/crash/content/browser/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698