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/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // navigating to the URL. | 44 // navigating to the URL. |
45 bool HasWrongProcessForURL(const GURL& url); | 45 bool HasWrongProcessForURL(const GURL& url); |
46 | 46 |
47 // Sets the global factory used to create new RenderProcessHosts. It may be | 47 // Sets the global factory used to create new RenderProcessHosts. It may be |
48 // NULL, in which case the default BrowserRenderProcessHost will be created | 48 // NULL, in which case the default BrowserRenderProcessHost will be created |
49 // (this is the behavior if you don't call this function). The factory must | 49 // (this is the behavior if you don't call this function). The factory must |
50 // be set back to NULL before it's destroyed; ownership is not transferred. | 50 // be set back to NULL before it's destroyed; ownership is not transferred. |
51 static void set_render_process_host_factory( | 51 static void set_render_process_host_factory( |
52 const RenderProcessHostFactory* rph_factory); | 52 const RenderProcessHostFactory* rph_factory); |
53 | 53 |
| 54 // Get the effective URL for the given actual URL. |
| 55 static GURL GetEffectiveURL(BrowserContext* browser_context, |
| 56 const GURL& url); |
| 57 |
54 protected: | 58 protected: |
55 friend class BrowsingInstance; | 59 friend class BrowsingInstance; |
56 friend class SiteInstance; | 60 friend class SiteInstance; |
57 | 61 |
58 // Virtual to allow tests to extend it. | 62 // Virtual to allow tests to extend it. |
59 virtual ~SiteInstanceImpl(); | 63 virtual ~SiteInstanceImpl(); |
60 | 64 |
61 // Create a new SiteInstance. Protected to give access to BrowsingInstance | 65 // Create a new SiteInstance. Protected to give access to BrowsingInstance |
62 // and tests; most callers should use Create or GetRelatedSiteInstance | 66 // and tests; most callers should use Create or GetRelatedSiteInstance |
63 // instead. | 67 // instead. |
64 explicit SiteInstanceImpl(BrowsingInstance* browsing_instance); | 68 explicit SiteInstanceImpl(BrowsingInstance* browsing_instance); |
65 | 69 |
66 private: | 70 private: |
67 // Get the effective URL for the given actual URL. | |
68 static GURL GetEffectiveURL(BrowserContext* browser_context, | |
69 const GURL& url); | |
70 | |
71 // NotificationObserver implementation. | 71 // NotificationObserver implementation. |
72 virtual void Observe(int type, | 72 virtual void Observe(int type, |
73 const NotificationSource& source, | 73 const NotificationSource& source, |
74 const NotificationDetails& details) OVERRIDE; | 74 const NotificationDetails& details) OVERRIDE; |
75 | 75 |
76 // Used to restrict a process' origin access rights. | 76 // Used to restrict a process' origin access rights. |
77 void LockToOrigin(); | 77 void LockToOrigin(); |
78 | 78 |
79 // An object used to construct RenderProcessHosts. | 79 // An object used to construct RenderProcessHosts. |
80 static const RenderProcessHostFactory* g_render_process_host_factory_; | 80 static const RenderProcessHostFactory* g_render_process_host_factory_; |
(...skipping 24 matching lines...) Expand all Loading... |
105 | 105 |
106 // Whether SetSite has been called. | 106 // Whether SetSite has been called. |
107 bool has_site_; | 107 bool has_site_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); | 109 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace content | 112 } // namespace content |
113 | 113 |
114 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 114 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
OLD | NEW |