From 683f427dbbd30a59c9026e6bab664792a19e723c Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Thu, 17 Apr 2014 20:42:18 +0000 Subject: Move some methods related to single-process out of content/public, since they're only called inside content. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/241353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264628 0039d316-1c4b-4281-b951-d872f2087c98 --- content/app/content_main_runner.cc | 8 ++++---- content/browser/renderer_host/render_process_host_impl.cc | 10 +++++----- content/browser/renderer_host/render_process_host_impl.h | 6 ++++++ content/browser/utility_process_host_impl.cc | 2 +- content/browser/utility_process_host_impl.h | 6 ++++++ content/public/browser/render_process_host.h | 6 ------ content/public/browser/utility_process_host.h | 6 ------ content/public/test/content_test_suite_base.cc | 8 ++++---- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index 2276f1a..b25dc20 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc @@ -27,6 +27,8 @@ #include "base/strings/stringprintf.h" #include "content/browser/browser_main.h" #include "content/browser/gpu/gpu_process_host.h" +#include "content/browser/renderer_host/render_process_host_impl.h" +#include "content/browser/utility_process_host_impl.h" #include "content/common/set_process_title.h" #include "content/common/url_schemes.h" #include "content/gpu/in_process_gpu_thread.h" @@ -34,8 +36,6 @@ #include "content/public/app/content_main_delegate.h" #include "content/public/app/startup_helper_win.h" #include "content/public/browser/content_browser_client.h" -#include "content/public/browser/render_process_host.h" -#include "content/public/browser/utility_process_host.h" #include "content/public/common/content_client.h" #include "content/public/common/content_constants.h" #include "content/public/common/content_paths.h" @@ -403,9 +403,9 @@ int RunZygote(const MainFunctionParams& main_function_params, #if !defined(OS_IOS) static void RegisterMainThreadFactories() { #if !defined(CHROME_MULTIPLE_DLL_BROWSER) - UtilityProcessHost::RegisterUtilityMainThreadFactory( + UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( CreateInProcessUtilityThread); - RenderProcessHost::RegisterRendererMainThreadFactory( + RenderProcessHostImpl::RegisterRendererMainThreadFactory( CreateInProcessRendererThread); GpuProcessHost::RegisterGpuMainThreadFactory( CreateInProcessGpuThread); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index bdf8442..933e101 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -324,11 +324,6 @@ class RendererSandboxedProcessLauncherDelegate RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; -void RenderProcessHost::RegisterRendererMainThreadFactory( - RendererMainThreadFactoryFunction create) { - g_renderer_main_thread_factory = create; -} - base::MessageLoop* g_in_process_thread; base::MessageLoop* @@ -467,6 +462,11 @@ void RenderProcessHostImpl::ShutDownInProcessRenderer() { } } +void RenderProcessHostImpl::RegisterRendererMainThreadFactory( + RendererMainThreadFactoryFunction create) { + g_renderer_main_thread_factory = create; +} + RenderProcessHostImpl::~RenderProcessHostImpl() { #ifndef NDEBUG DCHECK(is_self_deleted_) diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index cb59320..284332f 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h @@ -52,6 +52,9 @@ class ScreenOrientationDispatcherHost; class StoragePartition; class StoragePartitionImpl; +typedef base::Thread* (*RendererMainThreadFactoryFunction)( + const std::string& id); + // Implements a concrete RenderProcessHost for the browser process for talking // to actual renderer processes (as opposed to mocks). // @@ -214,6 +217,9 @@ class CONTENT_EXPORT RenderProcessHostImpl // This forces a renderer that is running "in process" to shut down. static void ShutDownInProcessRenderer(); + static void RegisterRendererMainThreadFactory( + RendererMainThreadFactoryFunction create); + #if defined(OS_ANDROID) const scoped_refptr& browser_demuxer_android() { return browser_demuxer_android_; diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index e7110ce..ddc41a7 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -91,7 +91,7 @@ UtilityProcessHost* UtilityProcessHost::Create( return new UtilityProcessHostImpl(client, client_task_runner); } -void UtilityProcessHost::RegisterUtilityMainThreadFactory( +void UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( UtilityMainThreadFactoryFunction create) { g_utility_main_thread_factory = create; } diff --git a/content/browser/utility_process_host_impl.h b/content/browser/utility_process_host_impl.h index 413dab0..8486655 100644 --- a/content/browser/utility_process_host_impl.h +++ b/content/browser/utility_process_host_impl.h @@ -25,10 +25,16 @@ class Thread; namespace content { class BrowserChildProcessHostImpl; +typedef base::Thread* (*UtilityMainThreadFactoryFunction)( + const std::string& id); + class CONTENT_EXPORT UtilityProcessHostImpl : public NON_EXPORTED_BASE(UtilityProcessHost), public BrowserChildProcessHostDelegate { public: + static void RegisterUtilityMainThreadFactory( + UtilityMainThreadFactoryFunction create); + UtilityProcessHostImpl(UtilityProcessHostClient* client, base::SequencedTaskRunner* client_task_runner); virtual ~UtilityProcessHostImpl(); diff --git a/content/public/browser/render_process_host.h b/content/public/browser/render_process_host.h index c22d449..6424099 100644 --- a/content/public/browser/render_process_host.h +++ b/content/public/browser/render_process_host.h @@ -31,9 +31,6 @@ class RenderWidgetHost; class StoragePartition; struct GlobalRequestID; -typedef base::Thread* (*RendererMainThreadFactoryFunction)( - const std::string& id); - // Interface that represents the browser side of the browser <-> renderer // communication channel. There will generally be one RenderProcessHost per // renderer process. @@ -285,9 +282,6 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, // Returns the current max number of renderer processes used by the content // module. static size_t GetMaxRendererProcessCount(); - - static void RegisterRendererMainThreadFactory( - RendererMainThreadFactoryFunction create); }; } // namespace content. diff --git a/content/public/browser/utility_process_host.h b/content/public/browser/utility_process_host.h index c39c76e..756d50f 100644 --- a/content/public/browser/utility_process_host.h +++ b/content/public/browser/utility_process_host.h @@ -20,9 +20,6 @@ namespace content { class UtilityProcessHostClient; struct ChildProcessData; -typedef base::Thread* (*UtilityMainThreadFactoryFunction)( - const std::string& id); - // This class acts as the browser-side host to a utility child process. A // utility process is a short-lived process that is created to run a specific // task. This class lives solely on the IO thread. @@ -72,9 +69,6 @@ class UtilityProcessHost : public IPC::Sender, #if defined(OS_POSIX) virtual void SetEnv(const base::EnvironmentMap& env) = 0; #endif - - CONTENT_EXPORT static void RegisterUtilityMainThreadFactory( - UtilityMainThreadFactoryFunction create); }; }; // namespace content diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc index 53e5693..9f9be53 100644 --- a/content/public/test/content_test_suite_base.cc +++ b/content/public/test/content_test_suite_base.cc @@ -11,10 +11,10 @@ #include "base/threading/sequenced_worker_pool.h" #include "content/browser/browser_thread_impl.h" #include "content/browser/gpu/gpu_process_host.h" +#include "content/browser/renderer_host/render_process_host_impl.h" +#include "content/browser/utility_process_host_impl.h" #include "content/common/url_schemes.h" #include "content/gpu/in_process_gpu_thread.h" -#include "content/public/browser/render_process_host.h" -#include "content/public/browser/utility_process_host.h" #include "content/public/common/content_client.h" #include "content/renderer/in_process_renderer_thread.h" #include "content/utility/in_process_utility_thread.h" @@ -78,9 +78,9 @@ void ContentTestSuiteBase::RegisterContentSchemes( void ContentTestSuiteBase::RegisterInProcessThreads() { #if !defined(OS_IOS) - UtilityProcessHost::RegisterUtilityMainThreadFactory( + UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( CreateInProcessUtilityThread); - RenderProcessHost::RegisterRendererMainThreadFactory( + RenderProcessHostImpl::RegisterRendererMainThreadFactory( CreateInProcessRendererThread); GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); #endif -- cgit v1.1