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

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

Issue 2200693002: Refactor CrashDump*Manager to use a shared CrashDumpObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cast compile error Created 4 years, 4 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: components/crash/content/browser/crash_dump_manager_android.h
diff --git a/components/crash/content/browser/crash_dump_manager_android.h b/components/crash/content/browser/crash_dump_manager_android.h
index 79930f6a979573ab5d655b4ae7aba0bc9677f646..23363830e141d742de84627d08e58eb2fcdb3837 100644
--- a/components/crash/content/browser/crash_dump_manager_android.h
+++ b/components/crash/content/browser/crash_dump_manager_android.h
@@ -1,3 +1,4 @@
+
Robert Sesek 2016/08/04 16:59:01 nit: spurious blank line
Tobias Sargeant 2016/08/05 14:59:21 Done.
// Copyright 2013 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.
@@ -7,21 +8,9 @@
#include <map>
-#include "base/android/application_status_listener.h"
-#include "base/files/file.h"
#include "base/files/file_path.h"
-#include "base/macros.h"
-#include "base/process/kill.h"
-#include "base/process/process.h"
#include "base/synchronization/lock.h"
-#include "content/public/browser/browser_child_process_observer.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "content/public/common/process_type.h"
-
-namespace content {
-class RenderProcessHost;
-}
+#include "components/crash/content/browser/crash_dump_observer_android.h"
namespace breakpad {
@@ -34,20 +23,20 @@ namespace breakpad {
// a file descriptor where to write the minidump in the event of a crash.
// This class creates these file descriptors and associates them with render
// processes and take the appropriate action when the render process terminates.
-class CrashDumpManager : public content::BrowserChildProcessObserver,
- public content::NotificationObserver {
+class CrashDumpManager : public breakpad::CrashDumpObserver::Client {
public:
- // The embedder should create a single instance of the CrashDumpManager.
- static CrashDumpManager* GetInstance();
-
// Should be created on the UI thread.
- explicit CrashDumpManager(const base::FilePath& crash_dump_dir);
-
+ explicit CrashDumpManager(const base::FilePath& crash_dump_dir,
+ int mapping_index);
Robert Sesek 2016/08/04 16:59:01 What is |mapping_index| ? Should be documented.
Tobias Sargeant 2016/08/05 14:59:21 Done (combination of a better name, and a comment
~CrashDumpManager() override;
Robert Sesek 2016/08/04 16:59:01 // breakpad::CrashDumpObserver::Client implementat
Tobias Sargeant 2016/08/05 14:59:21 Done.
- // Returns a file that should be used to generate a minidump for the process
- // |child_process_id|.
- base::File CreateMinidumpFile(int child_process_id);
+ void OnChildStart(int child_process_id,
+ content::FileDescriptorInfo* mappings) override;
+ void OnChildExit(int child_process_id,
+ base::ProcessHandle pid,
+ content::ProcessType process_type,
+ base::TerminationStatus termination_status,
+ base::android::ApplicationState app_state) override;
private:
typedef std::map<int, base::FilePath> ChildProcessIDToMinidumpPath;
@@ -64,32 +53,11 @@ class CrashDumpManager : public content::BrowserChildProcessObserver,
MINIDUMP_STATUS_COUNT
};
- static void ProcessMinidump(const base::FilePath& minidump_path,
- base::ProcessHandle pid,
- content::ProcessType process_type,
- base::TerminationStatus termination_status,
- base::android::ApplicationState app_state);
-
- // content::BrowserChildProcessObserver implementation:
- void BrowserChildProcessHostDisconnected(
- const content::ChildProcessData& data) override;
- void BrowserChildProcessCrashed(
- const content::ChildProcessData& data,
- int exit_code) override;
-
- // NotificationObserver implementation:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
- // Called on child process exit (including crash).
- void OnChildExit(int child_process_id,
- base::ProcessHandle pid,
- content::ProcessType process_type,
- base::TerminationStatus termination_status,
- base::android::ApplicationState app_state);
-
- content::NotificationRegistrar notification_registrar_;
+ void ProcessMinidump(const base::FilePath& minidump_path,
+ base::ProcessHandle pid,
+ content::ProcessType process_type,
+ base::TerminationStatus termination_status,
+ base::android::ApplicationState app_state);
// This map should only be accessed with its lock aquired as it is accessed
// from the PROCESS_LAUNCHER and UI threads.
@@ -97,8 +65,7 @@ class CrashDumpManager : public content::BrowserChildProcessObserver,
ChildProcessIDToMinidumpPath child_process_id_to_minidump_path_;
base::FilePath crash_dump_dir_;
-
- static CrashDumpManager* instance_;
+ int mapping_index_;
DISALLOW_COPY_AND_ASSIGN(CrashDumpManager);
};

Powered by Google App Engine
This is Rietveld 408576698