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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java

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
Index: chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java
deleted file mode 100644
index 033af29f96ae9b1e85fbf8a49089e16a3b2c2b40..0000000000000000000000000000000000000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.browser.crash;
-
-import android.os.AsyncTask;
-import android.os.FileObserver;
-
-import org.chromium.base.ContextUtils;
-import org.chromium.components.minidump_uploader.CrashFileManager;
-
-import java.io.File;
-
-/**
- * The FileObserver that monitors the minidump directory for new crash records.
- */
-public class MinidumpDirectoryObserver extends FileObserver {
- /**
- * A utility class to help manage the contents of the crash minidump local storage directory.
- */
- final CrashFileManager mFileManager;
-
- public MinidumpDirectoryObserver() {
- this(new CrashFileManager(ContextUtils.getApplicationContext().getCacheDir()));
- }
-
- private MinidumpDirectoryObserver(CrashFileManager fileManager) {
- // The file observer detects MOVED_TO for child processes.
- super(fileManager.getCrashDirectory().toString(), FileObserver.MOVED_TO);
- mFileManager = fileManager;
- }
-
- /**
- * When a minidump is detected, extract and append a logcat to it, then upload it to the crash
- * server.
- */
- @Override
- public void onEvent(int event, String path) {
- // This is executed on a thread dedicated to FileObserver.
- // Note: It's possible for |path| to be null: http://crbug.com/711404
- if (path != null && CrashFileManager.isMinidumpMIMEFirstTry(path)) {
- // Note that the logcat extraction might fail. This is ok; in that case, the minidump
- // will be found and uploaded upon the next browser launch.
- File minidump = mFileManager.getCrashFile(path);
- AsyncTask.THREAD_POOL_EXECUTOR.execute(new LogcatExtractionRunnable(minidump));
- }
- }
-}
« no previous file with comments | « chrome/android/java/DEPS ('k') | chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698