summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/chrome_dll_main.cc4
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc14
-rw-r--r--chrome/chrome.gyp76
-rw-r--r--chrome/renderer/render_view.cc6
-rw-r--r--chrome/worker/nativewebworker_impl.h3
-rw-r--r--chrome/worker/worker_main.cc2
-rw-r--r--chrome/worker/worker_thread.cc2
7 files changed, 50 insertions, 57 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 74ba339..9dff4b0 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -478,11 +478,7 @@ int ChromeMain(int argc, const char** argv) {
} else if (process_type == switches::kUtilityProcess) {
rv = UtilityMain(main_params);
} else if (process_type == switches::kWorkerProcess) {
-#if defined(OS_WIN)
rv = WorkerMain(main_params);
-#else
- NOTIMPLEMENTED();
-#endif
} else if (process_type == switches::kZygoteProcess) {
#if defined(OS_LINUX)
if (ZygoteMain(main_params)) {
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index 017ea86..d76fecb 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -8,6 +8,9 @@
#include "base/command_line.h"
#include "base/debug_util.h"
+#if defined(OS_POSIX)
+#include "base/global_descriptors_posix.h"
+#endif
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/process_util.h"
@@ -16,6 +19,7 @@
#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/worker_host/worker_service.h"
+#include "chrome/common/chrome_descriptors.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/debug_flags.h"
#include "chrome/common/process_watcher.h"
@@ -98,7 +102,15 @@ bool WorkerProcessHost::Init() {
#if defined(OS_WIN)
process = sandbox::StartProcess(&cmd_line);
#else
- base::LaunchApp(cmd_line, false, false, &process);
+ // This code is duplicated with browser_render_process_host.cc, but
+ // there's not a good place to de-duplicate it.
+ 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;
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index c3b9092..d8193bf 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -15,6 +15,7 @@
'debugger',
'renderer',
'utility',
+ 'worker',
'../printing/printing.gyp:printing',
'../webkit/webkit.gyp:inspector_resources',
],
@@ -2439,13 +2440,6 @@
'third_party/wtl/include',
],
},],
- # As of yet unported-from-Windows code.
- ['OS!="win"', {
- 'sources!': [
- 'renderer/webworker_proxy.cc',
- 'renderer/webworker_proxy.h',
- ],
- },],
],
},
{
@@ -2481,6 +2475,40 @@
}],
],
},
+ {
+ 'target_name': 'worker',
+ 'type': '<(library)',
+ 'msvs_guid': 'C78D02D0-A366-4EC6-A248-AA8E64C4BA18',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../webkit/webkit.gyp:webkit',
+ ],
+ 'sources': [
+ 'tools/build/win/precompiled.cc',
+ 'tools/build/win/precompiled.h',
+
+ 'worker/nativewebworker_impl.cc',
+ 'worker/nativewebworker_impl.h',
+ 'worker/nativewebworker_stub.cc',
+ 'worker/nativewebworker_stub.h',
+ 'worker/webworkerclient_proxy.cc',
+ 'worker/webworkerclient_proxy.h',
+ 'worker/worker_main.cc',
+ 'worker/worker_thread.cc',
+ 'worker/worker_thread.h',
+ 'worker/worker_webkitclient_impl.cc',
+ 'worker/worker_webkitclient_impl.h',
+ ],
+ 'include_dirs': [
+ '..',
+ ],
+ 'configurations': {
+ 'Debug': {
+ 'msvs_precompiled_header': 'tools/build/win/precompiled.h',
+ 'msvs_precompiled_source': 'tools/build/win/precompiled.cc',
+ },
+ },
+ },
{
'target_name': 'chrome',
'type': 'executable',
@@ -4943,40 +4971,6 @@
},
},
},
- {
- 'target_name': 'worker',
- 'type': '<(library)',
- 'msvs_guid': 'C78D02D0-A366-4EC6-A248-AA8E64C4BA18',
- 'dependencies': [
- '../base/base.gyp:base',
- '../webkit/webkit.gyp:webkit',
- ],
- 'sources': [
- 'tools/build/win/precompiled.cc',
- 'tools/build/win/precompiled.h',
-
- 'worker/nativewebworker_impl.cc',
- 'worker/nativewebworker_impl.h',
- 'worker/nativewebworker_stub.cc',
- 'worker/nativewebworker_stub.h',
- 'worker/webworkerclient_proxy.cc',
- 'worker/webworkerclient_proxy.h',
- 'worker/worker_main.cc',
- 'worker/worker_thread.cc',
- 'worker/worker_thread.h',
- 'worker/worker_webkitclient_impl.cc',
- 'worker/worker_webkitclient_impl.h',
- ],
- 'include_dirs': [
- '..',
- ],
- 'configurations': {
- 'Debug': {
- 'msvs_precompiled_header': 'tools/build/win/precompiled.h',
- 'msvs_precompiled_source': 'tools/build/win/precompiled.cc',
- },
- },
- },
]}, # 'targets'
], # OS=="win"
# TODO(jrg): add in Windows code coverage targets.
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 5f82399..012dc3f 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1874,13 +1874,7 @@ void RenderView::OnMissingPluginStatus(WebPluginDelegate* delegate,
}
WebWorker* RenderView::CreateWebWorker(WebWorkerClient* client) {
-#if defined(OS_WIN)
return new WebWorkerProxy(client, RenderThread::current(), routing_id_);
-#else
- // TODO(port): out of process workers
- NOTIMPLEMENTED();
- return NULL;
-#endif
}
void RenderView::OpenURL(WebView* webview, const GURL& url,
diff --git a/chrome/worker/nativewebworker_impl.h b/chrome/worker/nativewebworker_impl.h
index 5449e38..6e280cb 100644
--- a/chrome/worker/nativewebworker_impl.h
+++ b/chrome/worker/nativewebworker_impl.h
@@ -20,8 +20,7 @@ class NativeWebWorkerImpl : public WebKit::WebWorker {
explicit NativeWebWorkerImpl(WebKit::WebWorkerClient* client);
virtual ~NativeWebWorkerImpl();
- static WebWorker* NativeWebWorkerImpl::create(
- WebKit::WebWorkerClient* client);
+ static WebWorker* create(WebKit::WebWorkerClient* client);
// WebWorker implementation.
void startWorkerContext(const WebKit::WebURL& script_url,
diff --git a/chrome/worker/worker_main.cc b/chrome/worker/worker_main.cc
index e3846d4..03831b8b 100644
--- a/chrome/worker/worker_main.cc
+++ b/chrome/worker/worker_main.cc
@@ -20,8 +20,6 @@
// Mainline routine for running as the worker process.
int WorkerMain(const MainFunctionParams& parameters) {
- const CommandLine& parsed_command_line = parameters.command_line_;
-
// The main thread of the render process.
MessageLoopForIO main_message_loop;
std::wstring app_name = chrome::kBrowserAppName;
diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc
index 803fef3..7663b7a 100644
--- a/chrome/worker/worker_thread.cc
+++ b/chrome/worker/worker_thread.cc
@@ -54,5 +54,5 @@ void WorkerThread::OnControlMessageReceived(const IPC::Message& msg) {
void WorkerThread::OnCreateWorker(const GURL& url, int route_id) {
// WebWorkerClientProxy owns itself.
- WebWorkerClientProxy* worker = new WebWorkerClientProxy(url, route_id);
+ new WebWorkerClientProxy(url, route_id);
}