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

Unified Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 2861433002: Implement ProcessReusePolicy for SiteInstances (Closed)
Patch Set: Fixed ChromeOS issue Created 3 years, 7 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
Index: content/browser/renderer_host/render_process_host_impl.h
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index 05c8c7c3498e19d89e73252c60af9cae33d297d1..79ad6dbc013ed48f3e7299c61eca488906d53f78 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -72,10 +72,12 @@ class PermissionServiceContext;
class PeerConnectionTrackerHost;
class PushMessagingManager;
class RenderFrameMessageFilter;
+class RenderProcessHostFactory;
class RenderWidgetHelper;
class RenderWidgetHost;
class RenderWidgetHostImpl;
class ResourceMessageFilter;
+class SiteInstanceImpl;
class StoragePartition;
class StoragePartitionImpl;
@@ -253,6 +255,13 @@ class CONTENT_EXPORT RenderProcessHostImpl
RenderProcessHost* process,
const GURL& url);
+ // Returns a suitable RenderProcessHost to use for |site_instance|. Depending
+ // on the SiteInstance's ProcessReusePolicy and its url, this may be an
+ // existing RenderProcessHost or a new one.
+ static RenderProcessHost* GetProcessHostForSiteInstance(
+ BrowserContext* browser_context,
+ SiteInstanceImpl* site_instance);
+
static base::MessageLoop* GetInProcessRendererThreadForTesting();
// This forces a renderer that is running "in process" to shut down.
@@ -292,6 +301,13 @@ class CONTENT_EXPORT RenderProcessHostImpl
void OnAudioStreamRemoved() override;
int get_audio_stream_count_for_testing() const { return audio_stream_count_; }
+ // Sets the global factory used to create new RenderProcessHosts. It may be
+ // nullptr, in which case the default RenderProcessHost will be created (this
+ // is the behavior if you don't call this function). The factory must be set
+ // back to nullptr before it's destroyed; ownership is not transferred.
+ static void set_render_process_host_factory(
+ const RenderProcessHostFactory* rph_factory);
+
protected:
// A proxy for our IPC::Channel that lives on the IO thread.
std::unique_ptr<IPC::ChannelProxy> channel_;
@@ -389,6 +405,12 @@ class CONTENT_EXPORT RenderProcessHostImpl
// GpuSwitchingObserver implementation.
void OnGpuSwitched() override;
+ // Returns the default subframe RenderProcessHost to use for |site_instance|.
+ static RenderProcessHost* GetDefaultSubframeProcessHost(
+ BrowserContext* browser_context,
+ SiteInstanceImpl* site_instance,
+ bool is_for_guests_only);
+
#if BUILDFLAG(ENABLE_WEBRTC)
void OnRegisterAecDumpConsumer(int id);
void OnUnregisterAecDumpConsumer(int id);

Powered by Google App Engine
This is Rietveld 408576698