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

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

Issue 88503002: Have the unload event execute in background on cross-site navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Charlie's comments 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/frame_tree.h
diff --git a/content/browser/frame_host/frame_tree.h b/content/browser/frame_host/frame_tree.h
index 8aa85bb0e72db66510e729eff46e479212bc2d15..fb29df24de0d0fd5ac393981965fe01a8499876e 100644
--- a/content/browser/frame_host/frame_tree.h
+++ b/content/browser/frame_host/frame_tree.h
@@ -130,8 +130,8 @@ class CONTENT_EXPORT FrameTree {
FrameTreeNode* FindByFrameID(int64 frame_id);
private:
- typedef std::pair<RenderViewHostImpl*, int> RenderViewHostRefCount;
- typedef base::hash_map<int, RenderViewHostRefCount> RenderViewHostMap;
+ typedef base::hash_map<int, RenderViewHostImpl*> RenderViewHostMap;
+ typedef std::multimap<int, RenderViewHostImpl*> RenderViewHostMultiMap;
// These delegates are installed into all the RenderViewHosts and
// RenderFrameHosts that we create.
@@ -140,15 +140,23 @@ class CONTENT_EXPORT FrameTree {
RenderWidgetHostDelegate* render_widget_delegate_;
RenderFrameHostManager::Delegate* manager_delegate_;
- // Map of SiteInstance ID to a (RenderViewHost, refcount) pair. This allows
- // us to look up the RenderViewHost for a given SiteInstance when creating
- // RenderFrameHosts, and it allows us to call Shutdown on the RenderViewHost
- // and remove it from the map when no more RenderFrameHosts are using it.
+ // Map of SiteInstance ID to a RenderViewHost. This allows us to look up the
+ // RenderViewHost for a given SiteInstance when creating RenderFrameHosts.
+ // Combined with the refcount on RenderViewHost, this allows us to call
+ // Shutdown on the RenderViewHost and remove it from the map when no more
+ // RenderFrameHosts are using it.
//
// Must be declared before |root_| so that it is deleted afterward. Otherwise
// the map will be cleared before we delete the RenderFrameHosts in the tree.
RenderViewHostMap render_view_host_map_;
+ // Map of SiteInstance ID to RenderViewHosts that are pending shutdown. The
+ // renderers of these RVH are currently executing the unload event in
+ // background. When the SwapOutACK is received, they will be deleted. In the
+ // meantime, they are kept in this map, as they should not be reused (part of
+ // their state is already gone away).
+ RenderViewHostMultiMap render_view_host_pending_shutdown_map_;
+
scoped_ptr<FrameTreeNode> root_;
base::Callback<void(RenderViewHostImpl*, int64)> on_frame_removed_;
« no previous file with comments | « chrome/browser/renderer_host/web_cache_manager_browsertest.cc ('k') | content/browser/frame_host/frame_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698