summaryrefslogtreecommitdiffstats
path: root/chrome/browser/worker_host
diff options
context:
space:
mode:
authorlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-14 20:24:37 +0000
committerlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-14 20:24:37 +0000
commitd3851d562a059cf52a7539c87aedf132a3b824bd (patch)
treec61c56a9d5dcf64f44568d4e4d4141e26c834c74 /chrome/browser/worker_host
parent4948090e4385c271a374e94baf43d2dcc4c230ce (diff)
downloadchromium_src-d3851d562a059cf52a7539c87aedf132a3b824bd.zip
chromium_src-d3851d562a059cf52a7539c87aedf132a3b824bd.tar.gz
chromium_src-d3851d562a059cf52a7539c87aedf132a3b824bd.tar.bz2
Make workers functional on OSX and Linux.
BUG=http://crbug.com/16664 TEST=The same tests run for Web Workers on Windows should be run on Linux and OSX. Review URL: http://codereview.chromium.org/155015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc14
1 files changed, 13 insertions, 1 deletions
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;