diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 19:00:31 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 19:00:31 +0000 |
commit | d8c7cbccd6557ed455d9d4a212a2824972072505 (patch) | |
tree | ff9261a8931be3775c6c3786c4527a30cf6b5676 | |
parent | 21e8556f0651a4e132fde29bc4738229eaa3305b (diff) | |
download | chromium_src-d8c7cbccd6557ed455d9d4a212a2824972072505.zip chromium_src-d8c7cbccd6557ed455d9d4a212a2824972072505.tar.gz chromium_src-d8c7cbccd6557ed455d9d4a212a2824972072505.tar.bz2 |
Add an option to disable NaCl at compile time for platforms where it doesn't build yet
Just add disable_nacl=1 to gyp defines
Review URL: http://codereview.chromium.org/257029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27873 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/common.gypi | 11 | ||||
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/nacl_process_host.cc | 6 | ||||
-rw-r--r-- | chrome/browser/plugin_service.cc | 4 | ||||
-rwxr-xr-x | chrome/chrome.gyp | 6 | ||||
-rw-r--r-- | chrome/renderer/render_process.cc | 2 |
6 files changed, 29 insertions, 2 deletions
diff --git a/build/common.gypi b/build/common.gypi index 37526e2..d1dfc65 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -154,6 +154,10 @@ # Set to select the Title Case versions of strings in GRD files. 'use_titlecase_in_grd_files%': 0, + # Used to disable Native Client at compile time, for platforms where it + # isn't supported + 'disable_nacl%': 0, + 'conditions': [ ['OS=="linux"', { 'conditions': [ @@ -847,6 +851,13 @@ ], }, }], + ['disable_nacl==1', { + 'target_defaults': { + 'defines': [ + 'DISABLE_NACL', + ], + }, + }], ['msvs_use_common_linker_extras', { 'target_defaults': { 'msvs_settings': { diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 63dcc70..02f5b36 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -564,8 +564,10 @@ int ChromeMain(int argc, char** argv) { #endif } else if (process_type == switches::kWorkerProcess) { rv = WorkerMain(main_params); +#ifndef DISABLE_NACL } else if (process_type == switches::kNaClProcess) { rv = NaClMain(main_params); +#endif } else if (process_type == switches::kZygoteProcess) { #if defined(OS_LINUX) if (ZygoteMain(main_params)) { diff --git a/chrome/browser/nacl_process_host.cc b/chrome/browser/nacl_process_host.cc index 72db561..bb13ab7 100644 --- a/chrome/browser/nacl_process_host.cc +++ b/chrome/browser/nacl_process_host.cc @@ -39,6 +39,10 @@ NaClProcessHost::NaClProcessHost( bool NaClProcessHost::Launch(ResourceMessageFilter* renderer_msg_filter, const int descriptor, nacl::FileDescriptor* handle) { +#ifdef DISABLE_NACL + NOTIMPLEMENTED() << "Native Client disabled at build time"; + return false; +#else nacl::Handle pair[2]; bool success = false; // Create a connected socket @@ -80,6 +84,7 @@ bool NaClProcessHost::Launch(ResourceMessageFilter* renderer_msg_filter, #endif return true; +#endif // DISABLE_NACL } bool NaClProcessHost::LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter, @@ -184,4 +189,3 @@ URLRequestContext* NaClProcessHost::GetRequestContext( const ViewHostMsg_Resource_Request& request_data) { return NULL; } - diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index 5c5a8bb..fe71952 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -23,7 +23,9 @@ #include "chrome/common/notification_type.h" #include "chrome/common/notification_service.h" #include "chrome/common/render_messages.h" +#ifndef DISABLE_NACL #include "native_client/src/trusted/plugin/nacl_entry_points.h" +#endif #include "webkit/glue/plugins/plugin_constants_win.h" #include "webkit/glue/plugins/plugin_list.h" @@ -45,8 +47,10 @@ PluginService::PluginService() NPAPI::PluginList::Singleton()->AddExtraPluginPath( FilePath::FromWStringHack(path)); } +#ifndef DISABLE_NACL if (command_line->HasSwitch(switches::kInternalNaCl)) RegisterInternalNaClPlugin(); +#endif #if defined(OS_WIN) hkcu_key_.Create( diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ab2faf1..7a20754 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -2999,7 +2999,6 @@ 'msvs_guid': '9301A569-5D2B-4D11-9332-B1E30AEACB8D', 'dependencies': [ 'common', - 'nacl', 'plugin', 'chrome_resources', 'chrome_strings', @@ -3115,6 +3114,11 @@ ], }, 'conditions': [ + ['disable_nacl!=1', { + 'dependencies': [ + 'nacl', + ], + }], # Linux-specific rules. ['OS=="linux"', { 'dependencies': [ diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc index fbe38cf..6992a67 100644 --- a/chrome/renderer/render_process.cc +++ b/chrome/renderer/render_process.cc @@ -82,8 +82,10 @@ RenderProcess::RenderProcess() StatisticsRecorder::set_dump_on_exit(true); } +#ifndef DISABLE_NACL if (command_line.HasSwitch(switches::kInternalNaCl)) RegisterInternalNaClPlugin(RenderProcess::LaunchNaClProcess); +#endif if (command_line.HasSwitch(switches::kEnableByteRangeSupport)) { webkit_glue::SetMediaCacheEnabled(true); |