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

Unified Diff: chrome/browser/tab_contents/site_instance.h

Issue 18432: Factor out the test web contents from the WebContents unit test so that it ca... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_host/test_render_view_host.cc ('k') | chrome/browser/tab_contents/site_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/site_instance.h
===================================================================
--- chrome/browser/tab_contents/site_instance.h (revision 8331)
+++ chrome/browser/tab_contents/site_instance.h (working copy)
@@ -51,6 +51,16 @@
// Get the BrowsingInstance to which this SiteInstance belongs.
BrowsingInstance* browsing_instance() { return browsing_instance_; }
+ // Sets the factory used to create new RenderProcessHosts. This will also be
+ // passed on to SiteInstances spawned by this one.
+ //
+ // The factory must outlive the SiteInstance; ownership is not transferred. It
+ // may be NULL, in which case the default BrowserRenderProcessHost will be
+ // created (this is the behavior if you don't call this function).
+ void set_render_process_host_factory(RenderProcessHostFactory* rph_factory) {
+ render_process_host_factory_ = rph_factory;
+ }
+
// Set / Get the host ID for this SiteInstance's current RenderProcessHost.
void set_process_host_id(int process_host_id) {
process_host_id_ = process_host_id;
@@ -97,6 +107,9 @@
// new BrowsingInstance, so it should only be used when creating a new tab
// from scratch (or similar circumstances). Callers should ensure that
// this SiteInstance becomes ref counted, by storing it in a scoped_refptr.
+ //
+ // The render process host factory may be NULL. See SiteInstance constructor.
+ //
// TODO(creis): This may be an argument to build a pass_refptr<T> class, as
// Darin suggests.
static SiteInstance* CreateSiteInstance(Profile* profile);
@@ -122,6 +135,7 @@
// GetRelatedSiteInstance instead.
SiteInstance(BrowsingInstance* browsing_instance)
: browsing_instance_(browsing_instance),
+ render_process_host_factory_(NULL),
process_host_id_(-1),
max_page_id_(-1),
has_site_(false) {
@@ -132,6 +146,10 @@
// BrowsingInstance to which this SiteInstance belongs.
scoped_refptr<BrowsingInstance> browsing_instance_;
+ // Factory for new RenderProcessHosts, not owned by this class. NULL indiactes
+ // that the default BrowserRenderProcessHost should be created.
+ const RenderProcessHostFactory* render_process_host_factory_;
+
// Current host ID for the RenderProcessHost that is rendering pages for this
// SiteInstance. If the rendering process dies, this host ID can be
// replaced when a new process is created, without losing the association
« no previous file with comments | « chrome/browser/renderer_host/test_render_view_host.cc ('k') | chrome/browser/tab_contents/site_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698