| 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 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/browser/render_process_host_observer.h" | 10 #include "content/public/browser/render_process_host_observer.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 // Get the effective URL for the given actual URL. This allows the | 78 // Get the effective URL for the given actual URL. This allows the |
| 79 // ContentBrowserClient to override the SiteInstance's site for certain URLs. | 79 // ContentBrowserClient to override the SiteInstance's site for certain URLs. |
| 80 // For example, Chrome uses this to replace hosted app URLs with extension | 80 // For example, Chrome uses this to replace hosted app URLs with extension |
| 81 // hosts. | 81 // hosts. |
| 82 // Only public so that we can make a consistent process swap decision in | 82 // Only public so that we can make a consistent process swap decision in |
| 83 // RenderFrameHostManager. | 83 // RenderFrameHostManager. |
| 84 static GURL GetEffectiveURL(BrowserContext* browser_context, | 84 static GURL GetEffectiveURL(BrowserContext* browser_context, |
| 85 const GURL& url); | 85 const GURL& url); |
| 86 | 86 |
| 87 // Creates a new related SiteInstance that is not bound to a URL. |
| 88 // Note: use with care! When setting the URL later on for if it already exists |
| 89 // within the browsing instance that will lead to inconsistencies. |
| 90 SiteInstance* GetRelatedEmptySiteInstance(); |
| 91 |
| 87 protected: | 92 protected: |
| 88 friend class BrowsingInstance; | 93 friend class BrowsingInstance; |
| 89 friend class SiteInstance; | 94 friend class SiteInstance; |
| 90 | 95 |
| 91 // Virtual to allow tests to extend it. | 96 // Virtual to allow tests to extend it. |
| 92 ~SiteInstanceImpl() override; | 97 ~SiteInstanceImpl() override; |
| 93 | 98 |
| 94 // Create a new SiteInstance. Protected to give access to BrowsingInstance | 99 // Create a new SiteInstance. Protected to give access to BrowsingInstance |
| 95 // and tests; most callers should use Create or GetRelatedSiteInstance | 100 // and tests; most callers should use Create or GetRelatedSiteInstance |
| 96 // instead. | 101 // instead. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 134 |
| 130 // Whether SetSite has been called. | 135 // Whether SetSite has been called. |
| 131 bool has_site_; | 136 bool has_site_; |
| 132 | 137 |
| 133 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); | 138 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); |
| 134 }; | 139 }; |
| 135 | 140 |
| 136 } // namespace content | 141 } // namespace content |
| 137 | 142 |
| 138 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 143 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
| OLD | NEW |