Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: content/public/browser/site_instance.h

Issue 13533007: Test extension reloading behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Pawel's and Matt's comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_PUBLIC_BROWSER_SITE_INSTANCE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_
6 #define CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ 6 #define CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 12
13 namespace content { 13 namespace content {
14 class BrowserContext; 14 class BrowserContext;
15 class BrowsingInstance; 15 class BrowsingInstance;
16 class RenderProcessHost; 16 class RenderProcessHost;
17 class RenderProcessHostFactory;
17 18
18 /////////////////////////////////////////////////////////////////////////////// 19 ///////////////////////////////////////////////////////////////////////////////
19 // SiteInstance interface. 20 // SiteInstance interface.
20 // 21 //
21 // A SiteInstance represents a group of web pages that may be able to 22 // A SiteInstance represents a group of web pages that may be able to
22 // synchronously script each other, and thus must live in the same renderer 23 // synchronously script each other, and thus must live in the same renderer
23 // process. 24 // process.
24 // 25 //
25 // We identify this group using a combination of where the page comes from 26 // We identify this group using a combination of where the page comes from
26 // (the site) and which tabs have references to each other (the instance). 27 // (the site) and which tabs have references to each other (the instance).
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // class from the rest of the codebase.) 100 // class from the rest of the codebase.)
100 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as 101 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as
101 // Darin suggests. 102 // Darin suggests.
102 virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) = 0; 103 virtual SiteInstance* GetRelatedSiteInstance(const GURL& url) = 0;
103 104
104 // Returns whether the given SiteInstance is in the same BrowsingInstance as 105 // Returns whether the given SiteInstance is in the same BrowsingInstance as
105 // this one. If so, JavaScript interactions that are permitted across 106 // this one. If so, JavaScript interactions that are permitted across
106 // origins (e.g., postMessage) should be supported. 107 // origins (e.g., postMessage) should be supported.
107 virtual bool IsRelatedSiteInstance(const SiteInstance* instance) = 0; 108 virtual bool IsRelatedSiteInstance(const SiteInstance* instance) = 0;
108 109
110 // Sets the factory used to create new RenderProcessHosts. This will also be
111 // passed on to SiteInstances spawned by this one.
112 // The factory must outlive the SiteInstance; ownership is not transferred. It
113 // may be NULL, in which case the default BrowserRenderProcessHost will be
114 // created (this is the behavior if you don't call this function).
115 virtual void SetRenderProcessHostFactory(
jam 2013/04/08 15:49:06 nit: add a ForTesting suffix to the name
Jeffrey Yasskin 2013/04/08 16:30:48 Done.
116 const RenderProcessHostFactory* rph_factory) = 0;
117
109 // Factory method to create a new SiteInstance. This will create a new 118 // Factory method to create a new SiteInstance. This will create a new
110 // new BrowsingInstance, so it should only be used when creating a new tab 119 // new BrowsingInstance, so it should only be used when creating a new tab
111 // from scratch (or similar circumstances). Callers should ensure that 120 // from scratch (or similar circumstances). Callers should ensure that
112 // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. 121 // this SiteInstance becomes ref counted, by storing it in a scoped_refptr.
113 // 122 //
114 // The render process host factory may be NULL. See SiteInstance constructor. 123 // The render process host factory may be NULL. See SiteInstance constructor.
115 // 124 //
116 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as 125 // TODO(creis): This may be an argument to build a pass_refptr<T> class, as
117 // Darin suggests. 126 // Darin suggests.
118 static SiteInstance* Create(content::BrowserContext* browser_context); 127 static SiteInstance* Create(content::BrowserContext* browser_context);
(...skipping 22 matching lines...) Expand all
141 protected: 150 protected:
142 friend class base::RefCounted<SiteInstance>; 151 friend class base::RefCounted<SiteInstance>;
143 152
144 SiteInstance() {} 153 SiteInstance() {}
145 virtual ~SiteInstance() {} 154 virtual ~SiteInstance() {}
146 }; 155 };
147 156
148 } // namespace content. 157 } // namespace content.
149 158
150 #endif // CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_ 159 #endif // CONTENT_PUBLIC_BROWSER_SITE_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698