| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_HOST_SITE_INSTANCE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/renderer_host/render_process_host.h" | 9 #include "content/browser/renderer_host/render_process_host.h" |
| 10 #include "content/common/content_export.h" |
| 10 #include "content/common/notification_observer.h" | 11 #include "content/common/notification_observer.h" |
| 11 #include "content/common/notification_registrar.h" | 12 #include "content/common/notification_registrar.h" |
| 12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 13 | 14 |
| 14 class BrowsingInstance; | 15 class BrowsingInstance; |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class BrowserContext; | 18 class BrowserContext; |
| 18 } | 19 } |
| 19 | 20 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 44 // will be dedicated to each site. | 45 // will be dedicated to each site. |
| 45 // | 46 // |
| 46 // Each NavigationEntry for a TabContents points to the SiteInstance that | 47 // Each NavigationEntry for a TabContents points to the SiteInstance that |
| 47 // rendered it. Each RenderViewHost also points to the SiteInstance that it is | 48 // rendered it. Each RenderViewHost also points to the SiteInstance that it is |
| 48 // associated with. A SiteInstance keeps track of the number of these | 49 // associated with. A SiteInstance keeps track of the number of these |
| 49 // references and deletes itself when the count goes to zero. This means that | 50 // references and deletes itself when the count goes to zero. This means that |
| 50 // a SiteInstance is only live as long as it is accessible, either from new | 51 // a SiteInstance is only live as long as it is accessible, either from new |
| 51 // tabs with no NavigationEntries or in NavigationEntries in the history. | 52 // tabs with no NavigationEntries or in NavigationEntries in the history. |
| 52 // | 53 // |
| 53 /////////////////////////////////////////////////////////////////////////////// | 54 /////////////////////////////////////////////////////////////////////////////// |
| 54 class SiteInstance : public base::RefCounted<SiteInstance>, | 55 class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance>, |
| 55 public NotificationObserver { | 56 public NotificationObserver { |
| 56 public: | 57 public: |
| 57 // Returns a unique ID for this SiteInstance. | 58 // Returns a unique ID for this SiteInstance. |
| 58 int32 id() { return id_; } | 59 int32 id() { return id_; } |
| 59 | 60 |
| 60 // Get the BrowsingInstance to which this SiteInstance belongs. | 61 // Get the BrowsingInstance to which this SiteInstance belongs. |
| 61 BrowsingInstance* browsing_instance() { return browsing_instance_; } | 62 BrowsingInstance* browsing_instance() { return browsing_instance_; } |
| 62 | 63 |
| 63 // Sets the factory used to create new RenderProcessHosts. This will also be | 64 // Sets the factory used to create new RenderProcessHosts. This will also be |
| 64 // passed on to SiteInstances spawned by this one. | 65 // passed on to SiteInstances spawned by this one. |
| 65 // | 66 // |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // The web site that this SiteInstance is rendering pages for. | 206 // The web site that this SiteInstance is rendering pages for. |
| 206 GURL site_; | 207 GURL site_; |
| 207 | 208 |
| 208 // Whether SetSite has been called. | 209 // Whether SetSite has been called. |
| 209 bool has_site_; | 210 bool has_site_; |
| 210 | 211 |
| 211 DISALLOW_COPY_AND_ASSIGN(SiteInstance); | 212 DISALLOW_COPY_AND_ASSIGN(SiteInstance); |
| 212 }; | 213 }; |
| 213 | 214 |
| 214 #endif // CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ | 215 #endif // CONTENT_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ |
| OLD | NEW |