| 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_SITE_INSTANCE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 6 #define CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/renderer_host/render_process_host_impl.h" | 9 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "content/public/browser/site_instance.h" | 13 #include "content/public/browser/site_instance.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class RenderProcessHostFactory; | 17 class RenderProcessHostFactory; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class CONTENT_EXPORT SiteInstanceImpl : public content::SiteInstance, | 20 class CONTENT_EXPORT SiteInstanceImpl : public content::SiteInstance, |
| 21 public content::NotificationObserver { | 21 public content::NotificationObserver { |
| 22 public: | 22 public: |
| 23 // content::SiteInstance interface overrides. | 23 // content::SiteInstance interface overrides. |
| 24 virtual int32 GetId() OVERRIDE; | 24 virtual int32 GetId() OVERRIDE; |
| 25 virtual bool HasProcess() const OVERRIDE; | 25 virtual bool HasProcess() const OVERRIDE; |
| 26 virtual content::RenderProcessHost* GetProcess() OVERRIDE; | 26 virtual content::RenderProcessHost* GetProcess() OVERRIDE; |
| 27 virtual const GURL& GetSite() const OVERRIDE; | 27 virtual const GURL& GetSite() const OVERRIDE; |
| 28 virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) OVERRIDE; | 28 virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) OVERRIDE; |
| 29 virtual bool IsRelatedSiteInstance(const SiteInstance* instance) OVERRIDE; |
| 29 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 30 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
| 30 | 31 |
| 31 // Set the web site that this SiteInstance is rendering pages for. | 32 // Set the web site that this SiteInstance is rendering pages for. |
| 32 // This includes the scheme and registered domain, but not the port. If the | 33 // This includes the scheme and registered domain, but not the port. If the |
| 33 // URL does not have a valid registered domain, then the full hostname is | 34 // URL does not have a valid registered domain, then the full hostname is |
| 34 // stored. | 35 // stored. |
| 35 void SetSite(const GURL& url); | 36 void SetSite(const GURL& url); |
| 36 bool HasSite() const; | 37 bool HasSite() const; |
| 37 | 38 |
| 38 // Returns whether there is currently a related SiteInstance (registered with | 39 // Returns whether there is currently a related SiteInstance (registered with |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // will still remain the same even if the process crashes, since in that | 105 // will still remain the same even if the process crashes, since in that |
| 105 // scenario the RenderProcessHost remains the same. | 106 // scenario the RenderProcessHost remains the same. |
| 106 content::RenderProcessHost* process_; | 107 content::RenderProcessHost* process_; |
| 107 | 108 |
| 108 // The web site that this SiteInstance is rendering pages for. | 109 // The web site that this SiteInstance is rendering pages for. |
| 109 GURL site_; | 110 GURL site_; |
| 110 | 111 |
| 111 // Whether SetSite has been called. | 112 // Whether SetSite has been called. |
| 112 bool has_site_; | 113 bool has_site_; |
| 113 | 114 |
| 114 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, NewTabPageProcesses); | |
| 115 | |
| 116 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); | 115 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); |
| 117 }; | 116 }; |
| 118 | 117 |
| 119 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 118 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
| OLD | NEW |