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

Side by Side Diff: content/browser/browsing_instance.h

Issue 1797363002: "Top Document Isolation" mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two new browsertests. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_BROWSING_INSTANCE_H_ 5 #ifndef CONTENT_BROWSER_BROWSING_INSTANCE_H_
6 #define CONTENT_BROWSER_BROWSING_INSTANCE_H_ 6 #define CONTENT_BROWSER_BROWSING_INSTANCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // Returns whether this BrowsingInstance has registered a SiteInstance for 67 // Returns whether this BrowsingInstance has registered a SiteInstance for
68 // the site of the given URL. 68 // the site of the given URL.
69 bool HasSiteInstance(const GURL& url); 69 bool HasSiteInstance(const GURL& url);
70 70
71 // Get the SiteInstance responsible for rendering the given URL. Should 71 // Get the SiteInstance responsible for rendering the given URL. Should
72 // create a new one if necessary, but should not create more than one 72 // create a new one if necessary, but should not create more than one
73 // SiteInstance per site. 73 // SiteInstance per site.
74 SiteInstance* GetSiteInstanceForURL(const GURL& url); 74 SiteInstance* GetSiteInstanceForURL(const GURL& url);
75 75
76 SiteInstance* GetSiteInstanceForThirdPartySubframes(const GURL& url);
Charlie Reis 2016/03/18 21:15:13 We might not need this if we don't register subfra
77
76 // Adds the given SiteInstance to our map, to ensure that we do not create 78 // Adds the given SiteInstance to our map, to ensure that we do not create
77 // another SiteInstance for the same site. 79 // another SiteInstance for the same site.
78 void RegisterSiteInstance(SiteInstance* site_instance); 80 void RegisterSiteInstance(SiteInstance* site_instance);
79 81
80 // Removes the given SiteInstance from our map, after all references to it 82 // Removes the given SiteInstance from our map, after all references to it
81 // have been deleted. This means it is safe to create a new SiteInstance 83 // have been deleted. This means it is safe to create a new SiteInstance
82 // if the user later visits a page from this site, within this 84 // if the user later visits a page from this site, within this
83 // BrowsingInstance. 85 // BrowsingInstance.
84 void UnregisterSiteInstance(SiteInstance* site_instance); 86 void UnregisterSiteInstance(SiteInstance* site_instance);
85 87
(...skipping 27 matching lines...) Expand all
113 // obtained with SiteInstanceImpl::GetSiteForURL. Note that this map may not 115 // obtained with SiteInstanceImpl::GetSiteForURL. Note that this map may not
114 // contain every active SiteInstance, because a race exists where two 116 // contain every active SiteInstance, because a race exists where two
115 // SiteInstances can be assigned to the same site. This is ok in rare cases. 117 // SiteInstances can be assigned to the same site. This is ok in rare cases.
116 // It also does not contain SiteInstances which have not yet been assigned a 118 // It also does not contain SiteInstances which have not yet been assigned a
117 // site, such as about:blank. See NavigatorImpl::ShouldAssignSiteForURL. 119 // site, such as about:blank. See NavigatorImpl::ShouldAssignSiteForURL.
118 SiteInstanceMap site_instance_map_; 120 SiteInstanceMap site_instance_map_;
119 121
120 // Number of WebContentses currently using this BrowsingInstance. 122 // Number of WebContentses currently using this BrowsingInstance.
121 size_t active_contents_count_; 123 size_t active_contents_count_;
122 124
125 SiteInstance* site_instance_for_third_party_subframes_ = nullptr;
Charlie Reis 2016/03/18 21:15:13 We probably do want this, as the sole subframe SI
126
123 DISALLOW_COPY_AND_ASSIGN(BrowsingInstance); 127 DISALLOW_COPY_AND_ASSIGN(BrowsingInstance);
124 }; 128 };
125 129
126 } // namespace content 130 } // namespace content
127 131
128 #endif // CONTENT_BROWSER_BROWSING_INSTANCE_H_ 132 #endif // CONTENT_BROWSER_BROWSING_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698