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

Unified Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 72203003: Introduce RenderProcessHostObserver, use it in its first client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: release mode Created 7 years, 1 month 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/browser/renderer_host/render_process_host_impl.h
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index 681d3295cf3bf9f828414d0d1f63df157ddb4e64..7e42006bc79582356773039ffdf4031232ae0853 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -10,6 +10,7 @@
#include <string>
#include "base/memory/scoped_ptr.h"
+#include "base/observer_list.h"
#include "base/process/process.h"
#include "base/timer/timer.h"
#include "content/browser/child_process_launcher.h"
@@ -82,6 +83,8 @@ class CONTENT_EXPORT RenderProcessHostImpl
virtual int GetNextRoutingID() OVERRIDE;
virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE;
virtual void RemoveRoute(int32 routing_id) OVERRIDE;
+ virtual void AddObserver(RenderProcessHostObserver* observer) OVERRIDE;
+ virtual void RemoveObserver(RenderProcessHostObserver* observer) OVERRIDE;
virtual bool WaitForBackingStoreMsg(int render_widget_id,
const base::TimeDelta& max_delay,
IPC::Message* msg) OVERRIDE;
@@ -204,12 +207,18 @@ class CONTENT_EXPORT RenderProcessHostImpl
// True if we've posted a DeleteTask and will be deleted soon.
bool deleting_soon_;
+#ifndef NDEBUG
+ // True if this object has deleted itself.
+ bool is_self_deleted_;
+#endif
+
// The count of currently swapped out but pending RenderViews. We have
// started to swap these in, so the renderer process should not exit if
// this count is non-zero.
int32 pending_views_;
private:
+ friend class RenderProcessHost;
friend class VisitRelayingRenderProcessHost;
// Creates and adds the IO thread message filters.
@@ -307,6 +316,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Owned by |browser_context_|.
StoragePartitionImpl* storage_partition_impl_;
+ // The observers watching our lifetime.
+ ObserverList<RenderProcessHostObserver> observers_;
+
// True if the process can be shut down suddenly. If this is true, then we're
// sure that all the RenderViews in the process can be shutdown suddenly. If
// it's false, then specific RenderViews might still be allowed to be shutdown

Powered by Google App Engine
This is Rietveld 408576698