summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll_main.cc3
-rw-r--r--chrome/browser/nacl_process_host.cc187
-rw-r--r--chrome/browser/nacl_process_host.h55
-rw-r--r--chrome/browser/plugin_service.cc3
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc8
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h3
-rw-r--r--chrome/browser/sandbox_policy.cc8
-rw-r--r--chrome/chrome.gyp91
-rw-r--r--chrome/common/child_process_info.h1
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h3
-rw-r--r--chrome/common/nacl_messages.h19
-rw-r--r--chrome/common/nacl_messages_internal.h18
-rw-r--r--chrome/common/nacl_types.h21
-rw-r--r--chrome/common/render_messages_internal.h9
-rw-r--r--chrome/common/sandbox_init_wrapper.cc1
-rw-r--r--chrome/nacl/nacl_main.cc2
-rw-r--r--chrome/nacl/nacl_thread.cc7
-rw-r--r--chrome/nacl/nacl_thread.h11
-rw-r--r--chrome/nacl/sel_main.cc4
-rw-r--r--chrome/renderer/render_process.cc18
-rw-r--r--chrome/renderer/render_process.h5
-rw-r--r--chrome/renderer/render_view.cc8
24 files changed, 17 insertions, 475 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index b5b0b7b..9f135b5 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -83,7 +83,6 @@ extern int BrowserMain(const MainFunctionParams&);
extern int RendererMain(const MainFunctionParams&);
extern int PluginMain(const MainFunctionParams&);
extern int WorkerMain(const MainFunctionParams&);
-extern int NaClMain(const MainFunctionParams&);
extern int UtilityMain(const MainFunctionParams&);
extern int ProfileImportMain(const MainFunctionParams&);
extern int ZygoteMain(const MainFunctionParams&);
@@ -582,8 +581,6 @@ int ChromeMain(int argc, char** argv) {
#endif
} else if (process_type == switches::kWorkerProcess) {
rv = WorkerMain(main_params);
- } else if (process_type == switches::kNaClProcess) {
- rv = NaClMain(main_params);
} 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
deleted file mode 100644
index 72db561..0000000
--- a/chrome/browser/nacl_process_host.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright (c) 2009 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 "build/build_config.h"
-
-#include "chrome/browser/nacl_process_host.h"
-
-#if defined(OS_POSIX)
-#include <fcntl.h>
-#endif
-
-#if defined(OS_POSIX)
-#include "base/global_descriptors_posix.h"
-#endif
-#include "base/path_service.h"
-#include "base/process_util.h"
-#include "chrome/browser/renderer_host/resource_message_filter.h"
-#include "chrome/common/chrome_descriptors.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/logging_chrome.h"
-#include "chrome/common/nacl_messages.h"
-#include "ipc/ipc_switches.h"
-
-#if defined(OS_WIN)
-#include "chrome/browser/sandbox_policy.h"
-#endif
-
-#if defined(OS_POSIX)
-#include "ipc/ipc_channel_posix.h"
-#endif
-
-NaClProcessHost::NaClProcessHost(
- ResourceDispatcherHost *resource_dispatcher_host)
- : ChildProcessHost(NACL_PROCESS, resource_dispatcher_host),
- resource_dispatcher_host_(resource_dispatcher_host) {
-}
-
-bool NaClProcessHost::Launch(ResourceMessageFilter* renderer_msg_filter,
- const int descriptor,
- nacl::FileDescriptor* handle) {
- nacl::Handle pair[2];
- bool success = false;
- // Create a connected socket
- if (nacl::SocketPair(pair) == -1) {
- NATIVE_HANDLE(*handle) = nacl::kInvalidHandle;
- return false;
- }
-
- // Launch the process
- success = LaunchSelLdr(renderer_msg_filter, descriptor, pair[1]);
-
- if (!success) {
- nacl::Close(pair[0]);
- NATIVE_HANDLE(*handle) = nacl::kInvalidHandle;
- return false;
- }
-
- nacl::Handle duplicate_handle = nacl::kInvalidHandle;
-#if NACL_WINDOWS
- DuplicateHandle(base::GetCurrentProcessHandle(),
- reinterpret_cast<HANDLE>(pair[0]),
- renderer_msg_filter->handle(),
- reinterpret_cast<HANDLE*>(&duplicate_handle),
- GENERIC_READ | GENERIC_WRITE,
- FALSE,
- DUPLICATE_CLOSE_SOURCE);
- *handle = duplicate_handle;
-#else
- duplicate_handle = pair[0];
- int flags = fcntl(duplicate_handle, F_GETFD);
- if (flags != -1) {
- flags |= FD_CLOEXEC;
- fcntl(duplicate_handle, F_SETFD, flags);
- }
- // No need to dup the handle - we don't pass it anywhere else so
- // it cannot be closed.
- handle->fd = duplicate_handle;
- handle->auto_close = true;
-#endif
-
- return true;
-}
-
-bool NaClProcessHost::LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter,
- const int descriptor,
- const nacl::Handle handle) {
- if (!CreateChannel())
- return false;
-
- // Build command line for nacl.
- const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- std::wstring exe_path =
- browser_command_line.GetSwitchValue(switches::kBrowserSubprocessPath);
- if (exe_path.empty() && !PathService::Get(base::FILE_EXE, &exe_path))
- return false;
-
- CommandLine cmd_line(exe_path);
- if (logging::DialogsAreSuppressed())
- cmd_line.AppendSwitch(switches::kNoErrorDialogs);
-
- // propagate the following switches to the plugin command line (along with
- // any associated values) if present in the browser command line
- // TODO(gregoryd): check which flags of those below can be supported.
- static const wchar_t* const switch_names[] = {
- switches::kNoSandbox,
- switches::kTestSandbox,
- switches::kDisableBreakpad,
- switches::kFullMemoryCrashReport,
- switches::kEnableLogging,
- switches::kDisableLogging,
- switches::kLoggingLevel,
- switches::kEnableDCHECK,
- switches::kSilentDumpOnDCHECK,
- switches::kMemoryProfiling,
- };
-
- for (size_t i = 0; i < arraysize(switch_names); ++i) {
- if (browser_command_line.HasSwitch(switch_names[i])) {
- cmd_line.AppendSwitchWithValue(
- switch_names[i],
- browser_command_line.GetSwitchValue(switch_names[i]));
- }
- }
-
- cmd_line.AppendSwitchWithValue(switches::kProcessType,
- switches::kNaClProcess);
-
- cmd_line.AppendSwitchWithValue(switches::kProcessChannelID,
- ASCIIToWide(channel_id()));
-
- base::ProcessHandle process = 0;
-#if defined(OS_WIN)
- process = sandbox::StartProcess(&cmd_line);
-#else
- base::file_handle_mapping_vector fds_to_map;
- const int ipcfd = channel().GetClientFileDescriptor();
- if (ipcfd > -1)
- fds_to_map.push_back(std::pair<int, int>(
- ipcfd, kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
- base::LaunchApp(cmd_line.argv(), fds_to_map, false, &process);
-#endif
-
- if (!process)
- return false;
- SetHandle(process);
-
- // send a message with duplicated handle to sel_ldr
- return SendStartMessage(process, descriptor, handle);
-}
-
-bool NaClProcessHost::SendStartMessage(base::ProcessHandle process,
- int descriptor,
- nacl::Handle handle) {
- nacl::FileDescriptor channel;
-#if defined(OS_WIN)
- if (!DuplicateHandle(GetCurrentProcess(),
- reinterpret_cast<HANDLE>(handle),
- process,
- reinterpret_cast<HANDLE*>(&channel),
- GENERIC_READ | GENERIC_WRITE,
- FALSE, DUPLICATE_CLOSE_SOURCE)) {
- return false;
- }
-#else
- channel.fd = dup(handle);
- channel.auto_close = true;
-#endif
- NaClProcessMsg_Start* msg = new NaClProcessMsg_Start(descriptor,
- channel);
-
- if (!Send(msg)) {
- return false;
- }
- return true;
-}
-
-void NaClProcessHost::OnMessageReceived(const IPC::Message& msg) {
- NOTREACHED() << "Invalid message with type = " << msg.type();
-}
-
-URLRequestContext* NaClProcessHost::GetRequestContext(
- uint32 request_id,
- const ViewHostMsg_Resource_Request& request_data) {
- return NULL;
-}
-
diff --git a/chrome/browser/nacl_process_host.h b/chrome/browser/nacl_process_host.h
deleted file mode 100644
index 59de526..0000000
--- a/chrome/browser/nacl_process_host.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2009 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.
-
-#ifndef CHROME_BROWSER_NACL_PROCESS_HOST_H_
-#define CHROME_BROWSER_NACL_PROCESS_HOST_H_
-
-#include "build/build_config.h"
-#include "chrome/common/child_process_host.h"
-#include "chrome/common/nacl_types.h"
-#include "native_client/src/shared/imc/nacl_imc.h"
-
-class ResourceMessageFilter;
-
-// Represents the browser side of the browser <--> NaCl communication
-// channel. There will be one NaClProcessHost per NaCl process
-// The browser is responsible for starting the NaCl process
-// when requested by the renderer.
-// After that, most of the communication is directly between NaCl plugin
-// running in the renderer and NaCl processes.
-class NaClProcessHost : public ChildProcessHost {
- public:
- explicit NaClProcessHost(ResourceDispatcherHost *resource_dispatcher_host);
- ~NaClProcessHost() {}
-
- // Initialize the new NaCl process, returning true on success.
- bool Launch(ResourceMessageFilter* renderer_msg_filter,
- const int descriptor,
- nacl::FileDescriptor *handle);
-
- virtual void OnMessageReceived(const IPC::Message& msg);
-
- private:
- bool LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter,
- const int descriptor,
- const nacl::Handle handle);
-
- bool SendStartMessage(base::ProcessHandle process,
- int descriptor,
- nacl::Handle handle);
-
- // ResourceDispatcherHost::Receiver implementation:
- virtual URLRequestContext* GetRequestContext(
- uint32 request_id,
- const ViewHostMsg_Resource_Request& request_data);
-
- virtual bool CanShutdown() { return true; }
-
- private:
- ResourceDispatcherHost* resource_dispatcher_host_;
-
- DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
-};
-
-#endif // CHROME_BROWSER_NACL_PROCESS_HOST_H_
diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc
index 5c5a8bb..42a67e9 100644
--- a/chrome/browser/plugin_service.cc
+++ b/chrome/browser/plugin_service.cc
@@ -23,7 +23,6 @@
#include "chrome/common/notification_type.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
-#include "native_client/src/trusted/plugin/nacl_entry_points.h"
#include "webkit/glue/plugins/plugin_constants_win.h"
#include "webkit/glue/plugins/plugin_list.h"
@@ -45,8 +44,6 @@ PluginService::PluginService()
NPAPI::PluginList::Singleton()->AddExtraPluginPath(
FilePath::FromWStringHack(path));
}
- if (command_line->HasSwitch(switches::kInternalNaCl))
- RegisterInternalNaClPlugin();
#if defined(OS_WIN)
hkcu_key_.Create(
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 43482f1..fb91a80 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -326,7 +326,6 @@ bool BrowserRenderProcessHost::Init() {
switches::kDisableAudio,
switches::kSimpleDataSource,
switches::kEnableBenchmarking,
- switches::kInternalNaCl,
switches::kEnableDatabases,
};
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 3091033..0b8a923 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extension_message_service.h"
#include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h"
-#include "chrome/browser/nacl_process_host.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/plugin_service.h"
@@ -296,7 +295,6 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& msg) {
OnReceiveContextMenuMsg(msg))
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_OpenChannelToPlugin,
OnOpenChannelToPlugin)
- IPC_MESSAGE_HANDLER(ViewHostMsg_LaunchNaCl, OnLaunchNaCl)
IPC_MESSAGE_HANDLER(ViewHostMsg_CreateDedicatedWorker,
OnCreateDedicatedWorker)
IPC_MESSAGE_HANDLER(ViewHostMsg_CancelCreateDedicatedWorker,
@@ -587,12 +585,6 @@ void ResourceMessageFilter::OnOpenChannelToPlugin(const GURL& url,
this, url, mime_type, locale, reply_msg);
}
-void ResourceMessageFilter::OnLaunchNaCl(int channel_descriptor,
- nacl::FileDescriptor* handle) {
- NaClProcessHost* nacl_host = new NaClProcessHost(resource_dispatcher_host_);
- nacl_host->Launch(this, channel_descriptor, handle);
-}
-
void ResourceMessageFilter::OnCreateDedicatedWorker(const GURL& url,
int render_view_route_id,
int* route_id) {
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index ca37294..6b93eee 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -25,7 +25,6 @@
#include "chrome/browser/renderer_host/render_widget_helper.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/common/modal_dialog_event.h"
-#include "chrome/common/nacl_types.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/transport_dib.h"
#include "ipc/ipc_channel_proxy.h"
@@ -155,8 +154,6 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
const std::string& mime_type,
const std::wstring& locale,
IPC::Message* reply_msg);
- void OnLaunchNaCl(int channel_descriptor,
- nacl::FileDescriptor* handle);
void OnCreateDedicatedWorker(const GURL& url,
int render_view_route_id,
int* route_id);
diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc
index 784e5a7..13f4ee2 100644
--- a/chrome/browser/sandbox_policy.cc
+++ b/chrome/browser/sandbox_policy.cc
@@ -359,8 +359,6 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
type = ChildProcessInfo::PLUGIN_PROCESS;
} else if (type_str == switches::kWorkerProcess) {
type = ChildProcessInfo::WORKER_PROCESS;
- } else if (type_str == switches::kNaClProcess) {
- type = ChildProcessInfo::NACL_PROCESS;
} else if (type_str == switches::kUtilityProcess) {
type = ChildProcessInfo::UTILITY_PROCESS;
} else {
@@ -373,10 +371,8 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
(type != ChildProcessInfo::PLUGIN_PROCESS ||
browser_command_line.HasSwitch(switches::kSafePlugins));
#if !defined (GOOGLE_CHROME_BUILD)
- if (browser_command_line.HasSwitch(switches::kInProcessPlugins) ||
- browser_command_line.HasSwitch(switches::kInternalNaCl)) {
+ if (browser_command_line.HasSwitch(switches::kInProcessPlugins)) {
// In process plugins won't work if the sandbox is enabled.
- // The internal NaCl plugin doesn't work in the sandbox for now.
in_sandbox = false;
}
#endif
@@ -398,8 +394,6 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
sandbox::TargetPolicy* policy = broker_service->CreatePolicy();
bool on_sandbox_desktop = false;
- // TODO(gregoryd): try locked-down policy for sel_ldr after we fix IMC.
- // TODO(gregoryd): do we need a new desktop for sel_ldr?
if (type == ChildProcessInfo::PLUGIN_PROCESS) {
if (!AddPolicyForPlugin(cmd_line, policy))
return 0;
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 851c9cb..4ee61d0 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -108,26 +108,7 @@
'../views/grid_layout_unittest.cc',
],
'conditions': [
- ['OS=="win"', {
- 'nacl_defines': [
- 'NACL_WINDOWS=1',
- 'NACL_LINUX=0',
- 'NACL_OSX=0',
- ],
- },],
- ['OS=="linux"', {
- 'nacl_defines': [
- 'NACL_WINDOWS=0',
- 'NACL_LINUX=1',
- 'NACL_OSX=0',
- ],
- },],
['OS=="mac"', {
- 'nacl_defines': [
- 'NACL_WINDOWS=0',
- 'NACL_LINUX=0',
- 'NACL_OSX=1',
- ],
'conditions': [
['branding=="Chrome"', {
'mac_bundle_id': 'com.google.Chrome',
@@ -147,20 +128,6 @@
'chrome_personalization%': 0,
'use_syncapi_stub%': 1,
}], # OS=="win"
- ['target_arch=="ia32"', {
- 'nacl_defines': [
- # TODO(gregoryd): consider getting this from NaCl's common.gypi
- 'NACL_TARGET_SUBARCH=32',
- 'NACL_BUILD_SUBARCH=32',
- ],
- }],
- ['target_arch=="x64"', {
- 'nacl_defines': [
- # TODO(gregoryd): consider getting this from NaCl's common.gypi
- 'NACL_TARGET_SUBARCH=64',
- 'NACL_BUILD_SUBARCH=64',
- ],
- }],
], # conditions
}, # variables
'target_defaults': {
@@ -623,8 +590,6 @@
'common/sandbox_init_wrapper.h',
'common/security_filter_peer.cc',
'common/security_filter_peer.h',
- 'common/nacl_messages.h',
- 'common/nacl_messages_internal.h',
'common/sqlite_compiled_statement.cc',
'common/sqlite_compiled_statement.h',
'common/sqlite_utils.cc',
@@ -739,9 +704,6 @@
'..',
'<(INTERMEDIATE_DIR)',
],
- 'defines': [
- '<@(nacl_defines)',
- ],
'sources': [
# All .cc, .h, .m, and .mm files under browser except for tests and
# mocks.
@@ -1868,8 +1830,6 @@
'browser/search_engines/template_url_prepopulate_data.h',
'browser/search_engines/template_url_table_model.cc',
'browser/search_engines/template_url_table_model.h',
- 'browser/nacl_process_host.cc',
- 'browser/nacl_process_host.h',
'browser/session_startup_pref.cc',
'browser/session_startup_pref.h',
'browser/sessions/base_session_service.cc',
@@ -2912,57 +2872,11 @@
],
},
{
- 'target_name': 'nacl',
- 'type': '<(library)',
- 'msvs_guid': '83E86DAF-5763-4711-AD34-5FDAE395560C',
- 'dependencies': [
- 'common',
- 'chrome_resources',
- 'chrome_strings',
- '../third_party/npapi/npapi.gyp:npapi',
- '../webkit/webkit.gyp:glue',
- '../native_client/src/trusted/plugin/plugin_chrome.gyp:npGoogleNaClPluginChrome',
- '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
- '../native_client/src/trusted/validator_x86/validator_x86.gyp:ncvalidate',
- '../native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib',
- ],
- 'include_dirs': [
- '<(INTERMEDIATE_DIR)',
- ],
- 'defines': [
- 'NACL_BLOCK_SHIFT=5',
- 'NACL_BLOCK_SIZE=32',
- '<@(nacl_defines)',
- ],
- 'sources': [
- # All .cc, .h, .m, and .mm files under nacl except for tests and
- # mocks.
- 'nacl/sel_main.cc',
- 'nacl/nacl_main.cc',
- 'nacl/nacl_thread.cc',
- 'nacl/nacl_thread.h',
- ],
- # TODO(gregoryd): consider switching NaCl to use Chrome OS defines
- 'conditions': [
- ['OS=="win"', {
- 'defines': [
- '__STD_C',
- '_CRT_SECURE_NO_DEPRECATE',
- '_SCL_SECURE_NO_DEPRECATE',
- ],
- 'include_dirs': [
- 'third_party/wtl/include',
- ],
- },],
- ],
- },
- {
'target_name': 'renderer',
'type': '<(library)',
'msvs_guid': '9301A569-5D2B-4D11-9332-B1E30AEACB8D',
'dependencies': [
'common',
- 'nacl',
'plugin',
'chrome_resources',
'chrome_strings',
@@ -2977,9 +2891,6 @@
'include_dirs': [
'..',
],
- 'defines': [
- '<@(nacl_defines)',
- ],
'sources': [
# TODO(jrg): to link ipc_tests, these files need to be in renderer.a.
# But app/ is the wrong directory for them.
@@ -3457,8 +3368,6 @@
'infoplist_strings_tool',
# Bring in pdfsqueeze and run it on all pdfs
'../build/temp_gyp/pdfsqueeze.gyp:pdfsqueeze',
- # This library provides the real implementation for NaClSyscallSeg
- '../native_client/src/trusted/service_runtime/arch/x86_32/service_runtime_x86_32.gyp:service_runtime_x86_32_chrome'
],
'rules': [
{
diff --git a/chrome/common/child_process_info.h b/chrome/common/child_process_info.h
index c99b2c0..250ff57 100644
--- a/chrome/common/child_process_info.h
+++ b/chrome/common/child_process_info.h
@@ -17,7 +17,6 @@ class ChildProcessInfo {
RENDER_PROCESS,
PLUGIN_PROCESS,
WORKER_PROCESS,
- NACL_PROCESS,
UTILITY_PROCESS,
PROFILE_IMPORT_PROCESS,
ZYGOTE_PROCESS,
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 7fa5db0..14aea58 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -71,9 +71,6 @@ const wchar_t kPluginProcess[] = L"plugin";
// Causes the process to run as a worker subprocess.
const wchar_t kWorkerProcess[] = L"worker";
-// Causes the process to run as a NativeClient's sel_ldr subprocess.
-const wchar_t kNaClProcess[] = L"nacl";
-
// Causes the process to run as a utility subprocess.
const wchar_t kUtilityProcess[] = L"utility";
@@ -370,9 +367,6 @@ const wchar_t kEnableRemoteFonts[] = L"enable-remote-fonts";
// Use the low fragmentation heap for the CRT.
const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap";
-// Runs the Native Client inside the renderer process.
-const wchar_t kInternalNaCl[] = L"internal-nacl";
-
#ifndef NDEBUG
// Debug only switch to specify which gears plugin dll to load.
const wchar_t kGearsPluginPathOverride[] = L"gears-plugin-path";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index d5f7b9a..9ed753c 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -30,7 +30,6 @@ extern const wchar_t kZygoteProcess[];
extern const wchar_t kBrowserSubprocessPath[];
extern const wchar_t kPluginProcess[];
extern const wchar_t kWorkerProcess[];
-extern const wchar_t kNaClProcess[];
extern const wchar_t kUtilityProcess[];
extern const wchar_t kProfileImportProcess[];
extern const wchar_t kSingleProcess[];
@@ -134,8 +133,6 @@ extern const wchar_t kEnableRemoteFonts[];
extern const wchar_t kUseLowFragHeapCrt[];
-extern const wchar_t kInternalNaCl[];
-
#ifndef NDEBUG
extern const wchar_t kGearsPluginPathOverride[];
#endif
diff --git a/chrome/common/nacl_messages.h b/chrome/common/nacl_messages.h
deleted file mode 100644
index 8d360dd..0000000
--- a/chrome/common/nacl_messages.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2009 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.
-
-// Defines messages between the browser and NaCl process.
-
-#ifndef CHROME_COMMON_NACL_MESSAGES_H_
-#define CHROME_COMMON_NACL_MESSAGES_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "ipc/ipc_message_utils.h"
-
-#define MESSAGES_INTERNAL_FILE "chrome/common/nacl_messages_internal.h"
-#include "ipc/ipc_message_macros.h"
-
-#endif // CHROME_COMMON_NACL_MESSAGES_H_
-
diff --git a/chrome/common/nacl_messages_internal.h b/chrome/common/nacl_messages_internal.h
deleted file mode 100644
index 3794255..0000000
--- a/chrome/common/nacl_messages_internal.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2009 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/nacl_types.h"
-#include "ipc/ipc_message_macros.h"
-
-//-----------------------------------------------------------------------------
-// NaClProcess messages
-// These are messages sent from the browser to the NaCl process.
-IPC_BEGIN_MESSAGES(NaClProcess)
- // Tells the NaCl process to start.
- IPC_MESSAGE_CONTROL2(NaClProcessMsg_Start,
- int /* descriptor id */,
- nacl::FileDescriptor /* handle value */)
-
-IPC_END_MESSAGES(NaClProcess)
-
diff --git a/chrome/common/nacl_types.h b/chrome/common/nacl_types.h
deleted file mode 100644
index 394edd3..0000000
--- a/chrome/common/nacl_types.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2009 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.
-
-// Handle passing definitions for NaCl
-#ifndef CHROME_COMMON_NACL_TYPES_H_
-#define CHROME_COMMON_NACL_TYPES_H_
-
-// TODO(gregoryd): add a Windows definition for base::FileDescriptor,
-// replace the macros with inline functions.
-namespace nacl {
-#if defined(OS_WIN)
-typedef HANDLE FileDescriptor;
-#define NATIVE_HANDLE(desc) (desc)
-#elif defined(OS_POSIX)
-typedef base::FileDescriptor FileDescriptor;
-#define NATIVE_HANDLE(desc) ((desc).fd)
-#endif
-}
-
-#endif // CHROME_COMMON_NACL_TYPES_H_
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 11d14d5..4eec034 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -21,7 +21,6 @@
#include "base/values.h"
#include "chrome/common/css_colors.h"
#include "chrome/common/extensions/update_manifest.h"
-#include "chrome/common/nacl_types.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/transport_dib.h"
#include "chrome/common/view_types.h"
@@ -1090,14 +1089,6 @@ IPC_BEGIN_MESSAGES(ViewHost)
IPC::ChannelHandle /* handle to channel */,
WebPluginInfo /* info */)
- // A renderer sends this to the browser process when it wants to start
- // a new instance of the Native Client process. The browser will launch
- // the process and return a handle to an IMC channel.
- IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_LaunchNaCl,
- int /* channel number */,
- nacl::FileDescriptor /* handle - one side
- of a socket pair */)
-
#if defined(OS_LINUX)
// A renderer sends this when it needs a browser-side widget for
// hosting a windowed plugin. id is the XID of the plugin window, for which
diff --git a/chrome/common/sandbox_init_wrapper.cc b/chrome/common/sandbox_init_wrapper.cc
index 14006ed..c296ff8 100644
--- a/chrome/common/sandbox_init_wrapper.cc
+++ b/chrome/common/sandbox_init_wrapper.cc
@@ -27,7 +27,6 @@ void SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line,
if (!command_line.HasSwitch(switches::kNoSandbox)) {
if ((process_type == switches::kRendererProcess) ||
(process_type == switches::kWorkerProcess) ||
- (process_type == switches::kNaClProcess) ||
(process_type == switches::kUtilityProcess) ||
(process_type == switches::kPluginProcess &&
command_line.HasSwitch(switches::kSafePlugins))) {
diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc
index 0516495..f519748 100644
--- a/chrome/nacl/nacl_main.cc
+++ b/chrome/nacl/nacl_main.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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.
diff --git a/chrome/nacl/nacl_thread.cc b/chrome/nacl/nacl_thread.cc
index 3ed7c93..ff4f508 100644
--- a/chrome/nacl/nacl_thread.cc
+++ b/chrome/nacl/nacl_thread.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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/nacl/nacl_thread.h"
+#include "build/build_config.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/nacl_messages.h"
#include "native_client/src/trusted/service_runtime/include/sys/nacl_imc_api.h"
@@ -26,7 +27,7 @@ void NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
IPC_END_MESSAGE_MAP()
}
-void NaClThread::OnStartSelLdr(int channel_descriptor,
- nacl::FileDescriptor handle) {
+void NaClThread::OnStartSelLdr(const int channel_descriptor,
+ const nacl::FileDescriptor handle) {
SelMain(channel_descriptor, NATIVE_HANDLE(handle));
}
diff --git a/chrome/nacl/nacl_thread.h b/chrome/nacl/nacl_thread.h
index fd8fe76..a69ce3a 100644
--- a/chrome/nacl/nacl_thread.h
+++ b/chrome/nacl/nacl_thread.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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.
@@ -23,10 +23,13 @@ class NaClThread : public ChildThread {
private:
virtual void OnControlMessageReceived(const IPC::Message& msg);
- void OnStartSelLdr(int channel_descriptor, nacl::FileDescriptor handle);
-
+ void OnStartSelLdr(const int channel_descriptor,
+ const nacl::FileDescriptor handle);
// TODO(gregoryd): do we need to override Cleanup as in PluginThread?
- DISALLOW_COPY_AND_ASSIGN(NaClThread);
+
+ scoped_ptr<NotificationService> notification_service_;
+
+ DISALLOW_EVIL_CONSTRUCTORS(NaClThread);
};
#endif // CHROME_NACL_NACL_THREAD_H_
diff --git a/chrome/nacl/sel_main.cc b/chrome/nacl/sel_main.cc
index 7258205..7174706 100644
--- a/chrome/nacl/sel_main.cc
+++ b/chrome/nacl/sel_main.cc
@@ -1,7 +1,9 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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 "build/build_config.h"
+
#include "native_client/src/include/portability.h"
#if NACL_OSX
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc
index 0c579ea..610e5d3 100644
--- a/chrome/renderer/render_process.cc
+++ b/chrome/renderer/render_process.cc
@@ -25,13 +25,11 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/render_messages.h"
-#include "chrome/common/nacl_types.h"
#include "chrome/common/transport_dib.h"
#include "chrome/renderer/render_view.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_message_utils.h"
#include "media/base/media.h"
-#include "native_client/src/trusted/plugin/nacl_entry_points.h"
#include "webkit/glue/webkit_glue.h"
//-----------------------------------------------------------------------------
@@ -82,9 +80,6 @@ RenderProcess::RenderProcess()
StatisticsRecorder::set_dump_on_exit(true);
}
- if (command_line.HasSwitch(switches::kInternalNaCl))
- RegisterInternalNaClPlugin(RenderProcess::LaunchNaClProcess);
-
FilePath module_path;
initialized_media_library_ =
PathService::Get(base::DIR_MODULE, &module_path) &&
@@ -117,19 +112,6 @@ bool RenderProcess::InProcessPlugins() {
#endif
}
-bool RenderProcess::LaunchNaClProcess(int imc_fd,
- nacl::Handle* handle) {
- // TODO(gregoryd): nacl::FileDescriptor will be soon merged with
- // base::FileDescriptor
- nacl::FileDescriptor descriptor;
- if (!RenderThread::current()->Send(
- new ViewHostMsg_LaunchNaCl(imc_fd, &descriptor))) {
- return false;
- }
- *handle = NATIVE_HANDLE(descriptor);
- return true;
-}
-
// -----------------------------------------------------------------------------
// Platform specific code for dealing with bitmap transport...
diff --git a/chrome/renderer/render_process.h b/chrome/renderer/render_process.h
index 0ab9996..d445fbe 100644
--- a/chrome/renderer/render_process.h
+++ b/chrome/renderer/render_process.h
@@ -8,7 +8,6 @@
#include "base/timer.h"
#include "chrome/common/child_process.h"
#include "chrome/renderer/render_thread.h"
-#include "native_client/src/shared/imc/nacl_imc.h"
#include "skia/ext/platform_canvas.h"
namespace gfx {
@@ -52,10 +51,6 @@ class RenderProcess : public ChildProcess {
// Just like in_process_plugins(), but called before RenderProcess is created.
static bool InProcessPlugins();
- // Sends a message to the browser process asking to launch a new NaCl process.
- // Called from NaCl plugin code.
- static bool LaunchNaClProcess(int imc_fd, nacl::Handle *handle);
-
private:
// Look in the shared memory cache for a suitable object to reuse.
// result: (output) the memory found
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 2d2407d..842dfc0 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2357,13 +2357,7 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate(
else
mime_type_to_use = &mime_type;
- bool in_process_plugin = RenderProcess::current()->in_process_plugins();
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) {
- if (mime_type == "application/x-nacl-srpc") {
- in_process_plugin = true;
- }
- }
- if (in_process_plugin) {
+ if (RenderProcess::current()->in_process_plugins()) {
#if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac.
return WebPluginDelegateImpl::Create(
path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));