| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_BROWSING_INSTANCE_H__ | 5 #ifndef CHROME_BROWSER_BROWSING_INSTANCE_H__ |
| 6 #define CHROME_BROWSER_BROWSING_INSTANCE_H__ | 6 #define CHROME_BROWSER_BROWSING_INSTANCE_H__ |
| 7 | 7 |
| 8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // (This is currently only true if --process-per-site is specified at the | 38 // (This is currently only true if --process-per-site is specified at the |
| 39 // command line.) | 39 // command line.) |
| 40 // | 40 // |
| 41 // A BrowsingInstance is live as long as any SiteInstance has a reference to | 41 // A BrowsingInstance is live as long as any SiteInstance has a reference to |
| 42 // it. A SiteInstance is live as long as any NavigationEntry or RenderViewHost | 42 // it. A SiteInstance is live as long as any NavigationEntry or RenderViewHost |
| 43 // have references to it. Because both classes are RefCounted, they do not | 43 // have references to it. Because both classes are RefCounted, they do not |
| 44 // need to be manually deleted. | 44 // need to be manually deleted. |
| 45 // | 45 // |
| 46 // Currently, the BrowsingInstance class is not visible outside of the | 46 // Currently, the BrowsingInstance class is not visible outside of the |
| 47 // SiteInstance class. To get a new SiteInstance that is part of the same | 47 // SiteInstance class. To get a new SiteInstance that is part of the same |
| 48 // BrowsingInstance, use SiteInstance::GetRelatedSiteInstance. | 48 // BrowsingInstance, use SiteInstance::GetRelatedSiteInstance. Because of |
| 49 // this, BrowsingInstances and SiteInstances are tested together in |
| 50 // site_instance_unittest.cc. |
| 49 // | 51 // |
| 50 /////////////////////////////////////////////////////////////////////////////// | 52 /////////////////////////////////////////////////////////////////////////////// |
| 51 class BrowsingInstance : public base::RefCounted<BrowsingInstance> { | 53 class BrowsingInstance : public base::RefCounted<BrowsingInstance> { |
| 52 public: | 54 public: |
| 53 // Create a new BrowsingInstance. | 55 // Create a new BrowsingInstance. |
| 54 BrowsingInstance(Profile* profile) | 56 BrowsingInstance(Profile* profile) |
| 55 : profile_(profile) { | 57 : profile_(profile) { |
| 56 } | 58 } |
| 57 | 59 |
| 58 // Virtual to allow tests to extend it. | 60 // Virtual to allow tests to extend it. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // This field is only used if we are not using process-per-site. | 121 // This field is only used if we are not using process-per-site. |
| 120 SiteInstanceMap site_instance_map_; | 122 SiteInstanceMap site_instance_map_; |
| 121 | 123 |
| 122 // Global map of Profile to SiteInstanceMap, for process-per-site. | 124 // Global map of Profile to SiteInstanceMap, for process-per-site. |
| 123 static ProfileSiteInstanceMap profile_site_instance_map_; | 125 static ProfileSiteInstanceMap profile_site_instance_map_; |
| 124 | 126 |
| 125 DISALLOW_EVIL_CONSTRUCTORS(BrowsingInstance); | 127 DISALLOW_EVIL_CONSTRUCTORS(BrowsingInstance); |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 #endif // CHROME_BROWSER_BROWSING_INSTANCE_H__ | 130 #endif // CHROME_BROWSER_BROWSING_INSTANCE_H__ |
| OLD | NEW |