OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/worker_host/worker_process_host.h" | 5 #include "content/browser/worker_host/worker_process_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 ChildProcessSecurityPolicy::GetInstance()->Remove(id()); | 114 ChildProcessSecurityPolicy::GetInstance()->Remove(id()); |
115 } | 115 } |
116 | 116 |
117 bool WorkerProcessHost::Init(int render_process_id) { | 117 bool WorkerProcessHost::Init(int render_process_id) { |
118 if (!CreateChannel()) | 118 if (!CreateChannel()) |
119 return false; | 119 return false; |
120 | 120 |
121 FilePath exe_path = GetChildPath(true); | 121 #if defined(OS_LINUX) |
| 122 int flags = CHILD_ALLOW_SELF; |
| 123 #else |
| 124 int flags = CHILD_NORMAL; |
| 125 #endif |
| 126 |
| 127 FilePath exe_path = GetChildPath(flags); |
122 if (exe_path.empty()) | 128 if (exe_path.empty()) |
123 return false; | 129 return false; |
124 | 130 |
125 CommandLine* cmd_line = new CommandLine(exe_path); | 131 CommandLine* cmd_line = new CommandLine(exe_path); |
126 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kWorkerProcess); | 132 cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kWorkerProcess); |
127 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); | 133 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |
128 | 134 |
129 static const char* const kSwitchNames[] = { | 135 static const char* const kSwitchNames[] = { |
130 switches::kWebWorkerShareProcesses, | 136 switches::kWebWorkerShareProcesses, |
131 switches::kDisableApplicationCache, | 137 switches::kDisableApplicationCache, |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 638 } |
633 } | 639 } |
634 return false; | 640 return false; |
635 } | 641 } |
636 | 642 |
637 WorkerProcessHost::WorkerInstance::FilterInfo | 643 WorkerProcessHost::WorkerInstance::FilterInfo |
638 WorkerProcessHost::WorkerInstance::GetFilter() const { | 644 WorkerProcessHost::WorkerInstance::GetFilter() const { |
639 DCHECK(NumFilters() == 1); | 645 DCHECK(NumFilters() == 1); |
640 return *filters_.begin(); | 646 return *filters_.begin(); |
641 } | 647 } |
OLD | NEW |