diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-05 05:04:55 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-05 05:04:55 +0000 |
commit | 219b9b974fe4adf8069db2cb2d611c07f14798cc (patch) | |
tree | 2e7d3e8e92ecb7dea2ac0485a43c9feb2e13335c /chrome/app/chrome_main.cc | |
parent | 758eb9cda8f50d5d561aaf4a319d4f4f217b465a (diff) | |
download | chromium_src-219b9b974fe4adf8069db2cb2d611c07f14798cc.zip chromium_src-219b9b974fe4adf8069db2cb2d611c07f14798cc.tar.gz chromium_src-219b9b974fe4adf8069db2cb2d611c07f14798cc.tar.bz2 |
Reduce one of the implicit dependencies of src\content on chrome\renderer by moving the custom nacl
ppapi interface PPB_NACL_PRIVATE_INTERFACE to chrome\renderer. This interface is returned via a factory
which is registered in the renderer process, when the render thread is created.
This CL is intended to eventually help build src\content as an independent dll.
I also changed the ChromeContentRendererClient and ChromeContentPluginClient instances to be lazy instances
to fix some asserts i was seeing while running browser_tests.
BUG=82454
Review URL: http://codereview.chromium.org/7066069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_main.cc')
-rw-r--r-- | chrome/app/chrome_main.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index 20de46a..9614e56 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/i18n/icu_util.h" +#include "base/lazy_instance.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "base/message_loop.h" #include "base/metrics/stats_counters.h" @@ -90,6 +91,14 @@ #include "chrome/app/breakpad_linux.h" #endif +#if !defined(NACL_WIN64) // We don't build the renderer code on win nacl64. +base::LazyInstance<chrome::ChromeContentRendererClient> + g_chrome_content_renderer_client(base::LINKER_INITIALIZED); +#endif // NACL_WIN64 + +base::LazyInstance<chrome::ChromeContentPluginClient> + g_chrome_content_plugin_client(base::LINKER_INITIALIZED); + extern int BrowserMain(const MainFunctionParams&); extern int RendererMain(const MainFunctionParams&); extern int GpuMain(const MainFunctionParams&); @@ -220,15 +229,15 @@ void EnableHeapProfiler(const CommandLine& command_line) { void InitializeChromeContentRendererClient() { #if !defined(NACL_WIN64) // We don't build the renderer code on win nacl64. - static chrome::ChromeContentRendererClient chrome_content_renderer_client; - content::GetContentClient()->set_renderer(&chrome_content_renderer_client); + content::GetContentClient()->set_renderer( + &g_chrome_content_renderer_client.Get()); #endif } void InitializeChromeContentClient(const std::string& process_type) { if (process_type == switches::kPluginProcess) { - static chrome::ChromeContentPluginClient chrome_content_plugin_client; - content::GetContentClient()->set_plugin(&chrome_content_plugin_client); + content::GetContentClient()->set_plugin( + &g_chrome_content_plugin_client.Get()); } else if (process_type == switches::kRendererProcess || process_type == switches::kExtensionProcess) { InitializeChromeContentRendererClient(); |