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

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: fixes 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..52ee5fcae0ab19b662b2c4ecd6d972b10734714b 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,6 +207,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
// True if we've posted a DeleteTask and will be deleted soon.
bool deleting_soon_;
+ // True if the callback for the destruction of this object has been fired.
+ bool deletion_callback_called_;
+
// 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.
@@ -307,6 +313,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