| 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_TAB_CONTENTS_SITE_INSTANCE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_SITE_INSTANCE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_SITE_INSTANCE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_SITE_INSTANCE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/browsing_instance.h" | 8 #include "chrome/browser/browsing_instance.h" |
| 9 #include "chrome/browser/renderer_host/render_process_host.h" | 9 #include "chrome/browser/renderer_host/render_process_host.h" |
| 10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 static bool IsSameWebSite(const GURL& url1, const GURL& url2); | 131 static bool IsSameWebSite(const GURL& url1, const GURL& url2); |
| 132 | 132 |
| 133 protected: | 133 protected: |
| 134 friend class BrowsingInstance; | 134 friend class BrowsingInstance; |
| 135 | 135 |
| 136 // Create a new SiteInstance. Protected to give access to BrowsingInstance | 136 // Create a new SiteInstance. Protected to give access to BrowsingInstance |
| 137 // and tests; most callers should use CreateSiteInstance or | 137 // and tests; most callers should use CreateSiteInstance or |
| 138 // GetRelatedSiteInstance instead. | 138 // GetRelatedSiteInstance instead. |
| 139 SiteInstance(BrowsingInstance* browsing_instance); | 139 SiteInstance(BrowsingInstance* browsing_instance); |
| 140 | 140 |
| 141 // Returns the type of renderer process this instance belongs in, for grouping |
| 142 // purposes. |
| 143 RenderProcessHost::Type GetRendererType(); |
| 144 |
| 141 private: | 145 private: |
| 142 // NotificationObserver implementation. | 146 // NotificationObserver implementation. |
| 143 void Observe(NotificationType type, | 147 void Observe(NotificationType type, |
| 144 const NotificationSource& source, | 148 const NotificationSource& source, |
| 145 const NotificationDetails& details); | 149 const NotificationDetails& details); |
| 146 | 150 |
| 147 NotificationRegistrar registrar_; | 151 NotificationRegistrar registrar_; |
| 148 | 152 |
| 149 // BrowsingInstance to which this SiteInstance belongs. | 153 // BrowsingInstance to which this SiteInstance belongs. |
| 150 scoped_refptr<BrowsingInstance> browsing_instance_; | 154 scoped_refptr<BrowsingInstance> browsing_instance_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 167 // The web site that this SiteInstance is rendering pages for. | 171 // The web site that this SiteInstance is rendering pages for. |
| 168 GURL site_; | 172 GURL site_; |
| 169 | 173 |
| 170 // Whether SetSite has been called. | 174 // Whether SetSite has been called. |
| 171 bool has_site_; | 175 bool has_site_; |
| 172 | 176 |
| 173 DISALLOW_EVIL_CONSTRUCTORS(SiteInstance); | 177 DISALLOW_EVIL_CONSTRUCTORS(SiteInstance); |
| 174 }; | 178 }; |
| 175 | 179 |
| 176 #endif // CHROME_BROWSER_TAB_CONTENTS_SITE_INSTANCE_H_ | 180 #endif // CHROME_BROWSER_TAB_CONTENTS_SITE_INSTANCE_H_ |
| OLD | NEW |