OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/worker_host/worker_process_host.h" | 5 #include "chrome/browser/worker_host/worker_process_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug_util.h" | 10 #include "base/debug_util.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 i->renderer_process_id, i->render_view_route_id)); | 81 i->renderer_process_id, i->render_view_route_id)); |
82 } | 82 } |
83 | 83 |
84 ChildProcessSecurityPolicy::GetInstance()->Remove(GetProcessId()); | 84 ChildProcessSecurityPolicy::GetInstance()->Remove(GetProcessId()); |
85 } | 85 } |
86 | 86 |
87 bool WorkerProcessHost::Init() { | 87 bool WorkerProcessHost::Init() { |
88 if (!CreateChannel()) | 88 if (!CreateChannel()) |
89 return false; | 89 return false; |
90 | 90 |
91 std::wstring exe_path; | 91 std::wstring exe_path = GetChildPath(); |
92 if (!PathService::Get(base::FILE_EXE, &exe_path)) | 92 if (exe_path.empty()) |
93 return false; | 93 return false; |
94 | 94 |
95 CommandLine cmd_line(exe_path); | 95 CommandLine cmd_line(exe_path); |
96 cmd_line.AppendSwitchWithValue(switches::kProcessType, | 96 cmd_line.AppendSwitchWithValue(switches::kProcessType, |
97 switches::kWorkerProcess); | 97 switches::kWorkerProcess); |
98 cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, | 98 cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, |
99 ASCIIToWide(channel_id())); | 99 ASCIIToWide(channel_id())); |
100 | 100 |
101 if (CommandLine::ForCurrentProcess()->HasSwitch( | 101 if (CommandLine::ForCurrentProcess()->HasSwitch( |
102 switches::kEnableNativeWebWorkers)) { | 102 switches::kEnableNativeWebWorkers)) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 void WorkerProcessHost::OnCancelCreateDedicatedWorker(int route_id) { | 303 void WorkerProcessHost::OnCancelCreateDedicatedWorker(int route_id) { |
304 WorkerService::GetInstance()->CancelCreateDedicatedWorker( | 304 WorkerService::GetInstance()->CancelCreateDedicatedWorker( |
305 GetProcessId(), route_id); | 305 GetProcessId(), route_id); |
306 } | 306 } |
307 | 307 |
308 void WorkerProcessHost::OnForwardToWorker(const IPC::Message& message) { | 308 void WorkerProcessHost::OnForwardToWorker(const IPC::Message& message) { |
309 WorkerService::GetInstance()->ForwardMessage(message, GetProcessId()); | 309 WorkerService::GetInstance()->ForwardMessage(message, GetProcessId()); |
310 } | 310 } |
OLD | NEW |