| 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/callback.h" | 10 #include "base/callback.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 Launch( | 172 Launch( |
| 173 #if defined(OS_WIN) | 173 #if defined(OS_WIN) |
| 174 FilePath(), | 174 FilePath(), |
| 175 #elif defined(OS_POSIX) | 175 #elif defined(OS_POSIX) |
| 176 use_zygote, | 176 use_zygote, |
| 177 base::environment_vector(), | 177 base::environment_vector(), |
| 178 #endif | 178 #endif |
| 179 cmd_line); | 179 cmd_line); |
| 180 | 180 |
| 181 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 181 ChildProcessSecurityPolicy::GetInstance()->AddWorker( |
| 182 id(), render_process_id); |
| 182 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 183 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 183 switches::kDisableFileSystem)) { | 184 switches::kDisableFileSystem)) { |
| 184 // Grant most file permissions to this worker. | 185 // Grant most file permissions to this worker. |
| 185 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 186 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
| 186 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 187 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
| 187 // requests them. | 188 // requests them. |
| 188 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 189 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
| 189 id(), | 190 id(), |
| 190 resource_context_->file_system_context()-> | 191 resource_context_->file_system_context()-> |
| 191 path_manager()->sandbox_provider()->base_path(), | 192 path_manager()->sandbox_provider()->base_path(), |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 } | 632 } |
| 632 } | 633 } |
| 633 return false; | 634 return false; |
| 634 } | 635 } |
| 635 | 636 |
| 636 WorkerProcessHost::WorkerInstance::FilterInfo | 637 WorkerProcessHost::WorkerInstance::FilterInfo |
| 637 WorkerProcessHost::WorkerInstance::GetFilter() const { | 638 WorkerProcessHost::WorkerInstance::GetFilter() const { |
| 638 DCHECK(NumFilters() == 1); | 639 DCHECK(NumFilters() == 1); |
| 639 return *filters_.begin(); | 640 return *filters_.begin(); |
| 640 } | 641 } |
| OLD | NEW |