| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 Launch( | 169 Launch( |
| 170 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
| 171 FilePath(), | 171 FilePath(), |
| 172 #elif defined(OS_POSIX) | 172 #elif defined(OS_POSIX) |
| 173 use_zygote, | 173 use_zygote, |
| 174 base::environment_vector(), | 174 base::environment_vector(), |
| 175 #endif | 175 #endif |
| 176 cmd_line); | 176 cmd_line); |
| 177 | 177 |
| 178 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 178 ChildProcessSecurityPolicy::GetInstance()->AddWorker( |
| 179 id(), render_process_id); |
| 179 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 180 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 180 switches::kDisableFileSystem)) { | 181 switches::kDisableFileSystem)) { |
| 181 // Grant most file permissions to this worker. | 182 // Grant most file permissions to this worker. |
| 182 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 183 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
| 183 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 184 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
| 184 // requests them. | 185 // requests them. |
| 185 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 186 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
| 186 id(), | 187 id(), |
| 187 GetChromeURLRequestContext()->file_system_context()-> | 188 GetChromeURLRequestContext()->file_system_context()-> |
| 188 path_manager()->sandbox_provider()->base_path(), | 189 path_manager()->sandbox_provider()->base_path(), |
| (...skipping 442 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 |