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

Unified Diff: content/public/browser/browser_child_process_observer.h

Issue 12212089: content: convert child process notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots 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: content/public/browser/browser_child_process_observer.h
diff --git a/content/public/browser/browser_child_process_observer.h b/content/public/browser/browser_child_process_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..44711f3a0d8dae668e01ca7e8d97db4d89f7130f
--- /dev/null
+++ b/content/public/browser/browser_child_process_observer.h
@@ -0,0 +1,49 @@
+// Copyright (c) 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.
+
+#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_OBSERVER_H_
+#define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_OBSERVER_H_
+
+#include "base/basictypes.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+struct ChildProcessData;
+
+// An observer API implemented by classes which are interested
+// in browser child process events.
+class CONTENT_EXPORT BrowserChildProcessObserver {
+ public:
+ // Called when a child process host has connected to a child process.
+ virtual void BrowserChildProcessHostConnected(const ChildProcessData& data) {}
+
+ // Called after a ChildProcessHost is disconnected from the child process.
+ virtual void BrowserChildProcessHostDisconnected(
+ const ChildProcessData& data) {}
+
+ // Called when a child process disappears unexpectedly as a result of a crash.
+ virtual void BrowserChildProcessCrashed(const ChildProcessData& data) {}
+
+ // Called when an instance of a particular child is created in a page. If one
+ // page contains several regions rendered by the same child, this will be
+ // called once for each region during the page load.
+ virtual void BrowserChildProcessInstanceCreated(
+ const ChildProcessData& data) {}
+
+ protected:
+ // The observer can be created and destroyed on any thread.
+ BrowserChildProcessObserver() {}
+ virtual ~BrowserChildProcessObserver() {}
+
+ void StartObservingBrowserChildProcesses();
jam 2013/02/19 18:07:09 nit: make these be static methods (see content API
Paweł Hajdan Jr. 2013/02/20 12:11:42 Done. It wasn't obvious to me what the document wa
+ void StopObservingBrowserChildProcesses();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrowserChildProcessObserver);
jam 2013/02/19 18:07:09 nit: get rid of
Paweł Hajdan Jr. 2013/02/20 12:11:42 Done.
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698