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

Unified Diff: content/browser/frame_host/render_frame_host_manager.h

Issue 180993003: Revert "Revert 249676 "Have the unload event execute in background on cr..."" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete RFH pending shutdown in all nodes of the FrameTree Created 6 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/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);
};
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698