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

Unified Diff: chrome/browser/android/crash_dump_manager.h

Issue 12212089: content: convert child process notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 10 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/browser/android/crash_dump_manager.h
diff --git a/chrome/browser/android/crash_dump_manager.h b/chrome/browser/android/crash_dump_manager.h
index 6cfe49738f6a04a56b06d9ff39aa7e1fbd6eaef8..3a46b27e84f3e08446da18e832d7175f68bd7d43 100644
--- a/chrome/browser/android/crash_dump_manager.h
+++ b/chrome/browser/android/crash_dump_manager.h
@@ -11,6 +11,7 @@
#include "base/platform_file.h"
#include "base/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"
@@ -27,7 +28,8 @@ class RenderProcessHost;
// 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::NotificationObserver {
+class CrashDumpManager : public content::BrowserChildProcessObserver,
+ public content::NotificationObserver {
public:
// This object is a singleton created and owned by the
// ChromeBrowserMainPartsAndroid.
@@ -39,6 +41,12 @@ class CrashDumpManager : public content::NotificationObserver {
// the process |child_process_id|.
int CreateMinidumpFile(int child_process_id);
+ // content::BrowserChildProcessObserver implementation:
+ virtual void BrowserChildProcessHostDisconnected(
+ const content::ChildProcessData& data) OVERRIDE;
+ virtual void BrowserChildProcessCrashed(
+ const content::ChildProcessData& data) OVERRIDE;
+
private:
friend class ChromeBrowserMainPartsAndroid;
@@ -55,6 +63,9 @@ class CrashDumpManager : public content::NotificationObserver {
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::NotificationRegistrar notification_registrar_;
// This map should only be accessed with its lock aquired as it is accessed
« no previous file with comments | « no previous file | chrome/browser/android/crash_dump_manager.cc » ('j') | content/public/browser/browser_child_process_observer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698