OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/base_switches.h" | 11 #include "base/base_switches.h" |
11 #include "base/bind.h" | 12 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
13 #include "base/callback.h" | 14 #include "base/callback.h" |
14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
15 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 use_zygote = false; | 186 use_zygote = false; |
186 } | 187 } |
187 } | 188 } |
188 #endif | 189 #endif |
189 | 190 |
190 process_->Launch( | 191 process_->Launch( |
191 #if defined(OS_WIN) | 192 #if defined(OS_WIN) |
192 FilePath(), | 193 FilePath(), |
193 #elif defined(OS_POSIX) | 194 #elif defined(OS_POSIX) |
194 use_zygote, | 195 use_zygote, |
195 base::environment_vector(), | 196 base::EnvironmentVector(), |
196 #endif | 197 #endif |
197 cmd_line); | 198 cmd_line); |
198 | 199 |
199 fileapi::FileSystemContext* file_system_context = | 200 fileapi::FileSystemContext* file_system_context = |
200 ResourceContext::GetFileSystemContext(resource_context_); | 201 ResourceContext::GetFileSystemContext(resource_context_); |
201 ChildProcessSecurityPolicyImpl::GetInstance()->AddWorker( | 202 ChildProcessSecurityPolicyImpl::GetInstance()->AddWorker( |
202 process_->GetData().id, render_process_id); | 203 process_->GetData().id, render_process_id); |
203 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 204 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
204 switches::kDisableFileSystem)) { | 205 switches::kDisableFileSystem)) { |
205 // Grant most file permissions to this worker. | 206 // Grant most file permissions to this worker. |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 676 } |
676 } | 677 } |
677 return false; | 678 return false; |
678 } | 679 } |
679 | 680 |
680 WorkerProcessHost::WorkerInstance::FilterInfo | 681 WorkerProcessHost::WorkerInstance::FilterInfo |
681 WorkerProcessHost::WorkerInstance::GetFilter() const { | 682 WorkerProcessHost::WorkerInstance::GetFilter() const { |
682 DCHECK(NumFilters() == 1); | 683 DCHECK(NumFilters() == 1); |
683 return *filters_.begin(); | 684 return *filters_.begin(); |
684 } | 685 } |
OLD | NEW |