Index: content/browser/frame_host/render_frame_host_manager.h |
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h |
index 39b6b9f1ff1d899420a88dd39970879c4da2f85c..f1cc81c1a5c4ee79500c67b18ee7d4d390d6cb68 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.h |
+++ b/content/browser/frame_host/render_frame_host_manager.h |
@@ -12,6 +12,7 @@ |
#include "content/browser/renderer_host/render_view_host_delegate.h" |
#include "content/browser/site_instance_impl.h" |
#include "content/common/content_export.h" |
+#include "content/public/browser/global_request_id.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
#include "content/public/common/referrer.h" |
@@ -113,6 +114,11 @@ class CONTENT_EXPORT RenderFrameHostManager |
virtual ~Delegate() {} |
}; |
+ // Used with FrameTree::ForEach to delete RenderFrameHosts pending shutdown |
+ // from a FrameTreeNode's RenderFrameHostManager. Used during destruction of |
+ // WebContentsImpl. |
+ static bool ClearRFHsPendingShutdown(FrameTreeNode* node); |
+ |
// All three delegate pointers must be non-NULL and are not owned by this |
// class. They must outlive this class. The RenderViewHostDelegate and |
// RenderWidgetHostDelegate are what will be installed into all |
@@ -270,6 +276,10 @@ class CONTENT_EXPORT RenderFrameHostManager |
// to a new process after this completes or times out. |
void SwapOutOldPage(); |
+ // Deletes a RenderFrameHost that was pending shutdown. |
+ void ClearPendingShutdownRFHForSiteInstance(int32 site_instance_id, |
+ RenderFrameHostImpl* rfh); |
+ |
private: |
friend class RenderFrameHostManagerTest; |
friend class TestWebContents; |
@@ -440,6 +450,11 @@ class CONTENT_EXPORT RenderFrameHostManager |
typedef base::hash_map<int32, RenderFrameHostImpl*> RenderFrameHostMap; |
RenderFrameHostMap swapped_out_hosts_; |
+ // A map of RenderFrameHosts pending shutdown. |
+ typedef base::hash_map<int32, linked_ptr<RenderFrameHostImpl> > |
+ RFHPendingDeleteMap; |
+ RFHPendingDeleteMap pending_delete_hosts_; |
+ |
// The intersitial page currently shown if any, not own by this class |
// (the InterstitialPage is self-owned, it deletes itself when hidden). |
InterstitialPageImpl* interstitial_page_; |
@@ -453,6 +468,8 @@ class CONTENT_EXPORT RenderFrameHostManager |
// process as its parent. |
CrossProcessFrameConnector* cross_process_frame_connector_; |
+ base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
}; |