diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 21:14:44 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 21:14:44 +0000 |
commit | 93156cecb487ad7f1d7e307618cd58bd6546da29 (patch) | |
tree | ab60b7a310d1f8b2abae34e0b7c7703cf4dd2ced /chrome/app | |
parent | fd5633b12e0ed15c62e6e0001b52bd53b895299c (diff) | |
download | chromium_src-93156cecb487ad7f1d7e307618cd58bd6546da29.zip chromium_src-93156cecb487ad7f1d7e307618cd58bd6546da29.tar.gz chromium_src-93156cecb487ad7f1d7e307618cd58bd6546da29.tar.bz2 |
Make the NaCl windows 64 bit binaries not depend on chrome targets. These targets are very simple and used little code from chrome targets. However their dependency on chrome targets was problematic because a lot of code wasn't being built for 64 bit on Windows, and so there were a lot of "dummy" files being added with stub functions and code was also being compiled out in random places for NACL_WIN64.
I've made the NaCl 64 bit windows targets self contained. They do use a few files from common, but those files are self-contained. In the future, we could move these to be in the same 64 bit target as the constants from common. However that won't make a maintenance difference since someone could still introduce link dependencies to other files in common.
Additionally, since we're not using chrome code anymore, we can avoid having both nacl.exe and nacl.dll. nacl.exe is sufficient, and this saves 1.4MB of uncompresed binaries in the installer.
BUG=86322
Review URL: http://codereview.chromium.org/7863024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/chrome_exe_main_win.cc | 2 | ||||
-rw-r--r-- | chrome/app/chrome_main.cc | 16 | ||||
-rw-r--r-- | chrome/app/client_util.cc | 14 | ||||
-rw-r--r-- | chrome/app/dummy_main_functions.cc | 56 | ||||
-rw-r--r-- | chrome/app/nacl64_dll.ver | 2 |
5 files changed, 1 insertions, 89 deletions
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc index 659ce16..8d53054 100644 --- a/chrome/app/chrome_exe_main_win.cc +++ b/chrome/app/chrome_exe_main_win.cc @@ -9,7 +9,7 @@ #include "base/command_line.h" #include "chrome/app/breakpad_win.h" #include "chrome/app/client_util.h" -#include "content/app/sandbox_helper_win.h" +#include "content/app/startup_helper_win.h" #include "content/common/result_codes.h" #include "sandbox/src/sandbox_factory.h" diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index 0bedac4..8b69e3f 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -89,28 +89,21 @@ #include "chrome/app/breakpad_linux.h" #endif -#if !defined(NACL_WIN64) // We don't build the this code on win nacl64. base::LazyInstance<chrome::ChromeContentBrowserClient> g_chrome_content_browser_client(base::LINKER_INITIALIZED); base::LazyInstance<chrome::ChromeContentRendererClient> g_chrome_content_renderer_client(base::LINKER_INITIALIZED); base::LazyInstance<chrome::ChromeContentUtilityClient> g_chrome_content_utility_client(base::LINKER_INITIALIZED); -#endif // NACL_WIN64 - base::LazyInstance<chrome::ChromeContentPluginClient> g_chrome_content_plugin_client(base::LINKER_INITIALIZED); extern int RendererMain(const MainFunctionParams&); extern int NaClMain(const MainFunctionParams&); extern int ProfileImportMain(const MainFunctionParams&); -#if defined(_WIN64) -extern int NaClBrokerMain(const MainFunctionParams&); -#endif extern int ServiceProcessMain(const MainFunctionParams&); #if defined(OS_WIN) -// TODO(erikkay): isn't this already defined somewhere? #define DLLEXPORT __declspec(dllexport) // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. @@ -271,18 +264,14 @@ void EnableHeapProfiler(const CommandLine& command_line) { } void InitializeChromeContentRendererClient() { -#if !defined(NACL_WIN64) // We don't build the renderer code on win nacl64. content::GetContentClient()->set_renderer( &g_chrome_content_renderer_client.Get()); -#endif } void InitializeChromeContentClient(const std::string& process_type) { if (process_type.empty()) { -#if !defined(NACL_WIN64) // We don't build the this code on win nacl64. content::GetContentClient()->set_browser( &g_chrome_content_browser_client.Get()); -#endif } else if (process_type == switches::kPluginProcess) { content::GetContentClient()->set_plugin( &g_chrome_content_plugin_client.Get()); @@ -290,10 +279,8 @@ void InitializeChromeContentClient(const std::string& process_type) { process_type == switches::kExtensionProcess) { InitializeChromeContentRendererClient(); } else if (process_type == switches::kUtilityProcess) { -#if !defined(NACL_WIN64) // We don't build this code on win nacl64. content::GetContentClient()->set_utility( &g_chrome_content_utility_client.Get()); -#endif } } @@ -668,9 +655,6 @@ class ChromeMainDelegate : public content::ContentMainDelegate { #endif #if !defined(DISABLE_NACL) { switches::kNaClLoaderProcess, NaClMain }, -#if defined(_WIN64) // The broker process is used only on Win64. - { switches::kNaClBrokerProcess, NaClBrokerMain }, -#endif #endif // DISABLE_NACL }; diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index 06a1e99..79d92d1 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -168,21 +168,7 @@ bool GetPreReadExperimentGroup(DWORD* pre_read) { HMODULE LoadChromeWithDirectory(std::wstring* dir) { ::SetCurrentDirectoryW(dir->c_str()); const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); -#ifdef _WIN64 - if ((cmd_line.GetSwitchValueASCII(switches::kProcessType) == - switches::kNaClBrokerProcess) || - (cmd_line.GetSwitchValueASCII(switches::kProcessType) == - switches::kNaClLoaderProcess)) { - // Load the 64-bit DLL when running in a 64-bit process. - dir->append(installer::kChromeNaCl64Dll); - } else { - // Only NaCl broker and loader can be launched as Win64 processes. - NOTREACHED(); - return NULL; - } -#else dir->append(installer::kChromeDll); -#endif #ifndef WIN_DISABLE_PREREAD #ifdef NDEBUG diff --git a/chrome/app/dummy_main_functions.cc b/chrome/app/dummy_main_functions.cc deleted file mode 100644 index 4240564..0000000 --- a/chrome/app/dummy_main_functions.cc +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/common/chrome_result_codes.h" -#include "content/common/main_function_params.h" - -// Native Client binary for 64-bit Windows can run only the NaCl loader or -// the sandbox broker processes. Other process types are not supported. -int BrowserMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int RendererMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int PluginMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int PpapiPluginMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int PpapiBrokerMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int WorkerMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int UtilityMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int ProfileImportMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int ZygoteMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int DiagnosticsMain(const CommandLine& command_line) { - return 1; -} - -int GpuMain(const MainFunctionParams&) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} - -int ServiceProcessMain(const MainFunctionParams& parameters) { - return chrome::RESULT_CODE_BAD_PROCESS_TYPE; -} diff --git a/chrome/app/nacl64_dll.ver b/chrome/app/nacl64_dll.ver deleted file mode 100644 index 998c4a2..0000000 --- a/chrome/app/nacl64_dll.ver +++ /dev/null @@ -1,2 +0,0 @@ -INTERNAL_NAME=nacl64_dll -ORIGINAL_FILENAME=nacl64.dll |