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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 class CONTENT_EXPORT Observer { | 26 class CONTENT_EXPORT Observer { |
27 public: | 27 public: |
28 // Called when this SiteInstance transitions to having no active frames, | 28 // Called when this SiteInstance transitions to having no active frames, |
29 // as measured by active_frame_count(). | 29 // as measured by active_frame_count(). |
30 virtual void ActiveFrameCountIsZero(SiteInstanceImpl* site_instance) {} | 30 virtual void ActiveFrameCountIsZero(SiteInstanceImpl* site_instance) {} |
31 | 31 |
32 // Called when the renderer process of this SiteInstance has exited. | 32 // Called when the renderer process of this SiteInstance has exited. |
33 virtual void RenderProcessGone(SiteInstanceImpl* site_instance) = 0; | 33 virtual void RenderProcessGone(SiteInstanceImpl* site_instance) = 0; |
34 }; | 34 }; |
35 | 35 |
36 static scoped_refptr<SiteInstanceImpl> Create( | 36 // |child_process_param_id| is an opaque id passed to ChildProcessLauncher. |
37 BrowserContext* browser_context); | 37 // All frames in this site instance will inhert the same id. |
| 38 static scoped_refptr<SiteInstanceImpl> Create(BrowserContext* browser_context, |
| 39 int child_process_param_id); |
38 static scoped_refptr<SiteInstanceImpl> CreateForURL( | 40 static scoped_refptr<SiteInstanceImpl> CreateForURL( |
39 BrowserContext* browser_context, | 41 BrowserContext* browser_context, |
40 const GURL& url); | 42 const GURL& url, |
| 43 int child_process_param_id); |
41 | 44 |
42 // SiteInstance interface overrides. | 45 // SiteInstance interface overrides. |
43 int32_t GetId() override; | 46 int32_t GetId() override; |
44 bool HasProcess() const override; | 47 bool HasProcess() const override; |
45 RenderProcessHost* GetProcess() override; | 48 RenderProcessHost* GetProcess() override; |
46 BrowserContext* GetBrowserContext() const override; | 49 BrowserContext* GetBrowserContext() const override; |
47 const GURL& GetSiteURL() const override; | 50 const GURL& GetSiteURL() const override; |
48 scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override; | 51 scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override; |
49 bool IsRelatedSiteInstance(const SiteInstance* instance) override; | 52 bool IsRelatedSiteInstance(const SiteInstance* instance) override; |
50 size_t GetRelatedActiveContentsCount() override; | 53 size_t GetRelatedActiveContentsCount() override; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 bool is_default_subframe_site_instance_; | 189 bool is_default_subframe_site_instance_; |
187 | 190 |
188 base::ObserverList<Observer, true> observers_; | 191 base::ObserverList<Observer, true> observers_; |
189 | 192 |
190 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); | 193 DISALLOW_COPY_AND_ASSIGN(SiteInstanceImpl); |
191 }; | 194 }; |
192 | 195 |
193 } // namespace content | 196 } // namespace content |
194 | 197 |
195 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ | 198 #endif // CONTENT_BROWSER_SITE_INSTANCE_IMPL_H_ |
OLD | NEW |