| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // have references to it. Because both classes are RefCounted, they do not | 47 // have references to it. Because both classes are RefCounted, they do not |
| 48 // need to be manually deleted. | 48 // need to be manually deleted. |
| 49 // | 49 // |
| 50 // BrowsingInstance has no public members, as it is designed to be | 50 // BrowsingInstance has no public members, as it is designed to be |
| 51 // visible only from the SiteInstance class. To get a new | 51 // visible only from the SiteInstance class. To get a new |
| 52 // SiteInstance that is part of the same BrowsingInstance, use | 52 // SiteInstance that is part of the same BrowsingInstance, use |
| 53 // SiteInstance::GetRelatedSiteInstance. Because of this, | 53 // SiteInstance::GetRelatedSiteInstance. Because of this, |
| 54 // BrowsingInstances and SiteInstances are tested together in | 54 // BrowsingInstances and SiteInstances are tested together in |
| 55 // site_instance_unittest.cc. | 55 // site_instance_unittest.cc. |
| 56 // | 56 // |
| 57 // Note that a browsing instance in the browser is independently tracked in |
| 58 // the renderer inside blink::Page::RelatedPages() method (in theory the browser |
| 59 // and renderer should always stay in sync). |
| 60 // |
| 57 /////////////////////////////////////////////////////////////////////////////// | 61 /////////////////////////////////////////////////////////////////////////////// |
| 58 class CONTENT_EXPORT BrowsingInstance final | 62 class CONTENT_EXPORT BrowsingInstance final |
| 59 : public base::RefCounted<BrowsingInstance> { | 63 : public base::RefCounted<BrowsingInstance> { |
| 60 private: | 64 private: |
| 61 friend class base::RefCounted<BrowsingInstance>; | 65 friend class base::RefCounted<BrowsingInstance>; |
| 62 friend class SiteInstanceImpl; | 66 friend class SiteInstanceImpl; |
| 63 FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest, OneSiteInstancePerSite); | 67 FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest, OneSiteInstancePerSite); |
| 64 FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest, | 68 FRIEND_TEST_ALL_PREFIXES(SiteInstanceTest, |
| 65 OneSiteInstancePerSiteInBrowserContext); | 69 OneSiteInstancePerSiteInBrowserContext); |
| 66 | 70 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 size_t active_contents_count_; | 130 size_t active_contents_count_; |
| 127 | 131 |
| 128 SiteInstanceImpl* default_subframe_site_instance_ = nullptr; | 132 SiteInstanceImpl* default_subframe_site_instance_ = nullptr; |
| 129 | 133 |
| 130 DISALLOW_COPY_AND_ASSIGN(BrowsingInstance); | 134 DISALLOW_COPY_AND_ASSIGN(BrowsingInstance); |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 } // namespace content | 137 } // namespace content |
| 134 | 138 |
| 135 #endif // CONTENT_BROWSER_BROWSING_INSTANCE_H_ | 139 #endif // CONTENT_BROWSER_BROWSING_INSTANCE_H_ |
| OLD | NEW |