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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 175 ChildProcessSecurityPolicy::GetInstance()->Add(id()); |
176 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 176 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
177 switches::kDisableFileSystem)) { | 177 switches::kDisableFileSystem)) { |
178 // Grant most file permissions to this worker. | 178 // Grant most file permissions to this worker. |
179 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 179 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
180 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 180 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
181 // requests them. | 181 // requests them. |
182 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 182 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
183 id(), | 183 id(), |
184 request_context_->browser_file_system_context()-> | 184 request_context_->file_system_context()-> |
185 path_manager()->base_path(), | 185 path_manager()->base_path(), |
186 base::PLATFORM_FILE_OPEN | | 186 base::PLATFORM_FILE_OPEN | |
187 base::PLATFORM_FILE_CREATE | | 187 base::PLATFORM_FILE_CREATE | |
188 base::PLATFORM_FILE_OPEN_ALWAYS | | 188 base::PLATFORM_FILE_OPEN_ALWAYS | |
189 base::PLATFORM_FILE_CREATE_ALWAYS | | 189 base::PLATFORM_FILE_CREATE_ALWAYS | |
190 base::PLATFORM_FILE_READ | | 190 base::PLATFORM_FILE_READ | |
191 base::PLATFORM_FILE_WRITE | | 191 base::PLATFORM_FILE_WRITE | |
192 base::PLATFORM_FILE_EXCLUSIVE_READ | | 192 base::PLATFORM_FILE_EXCLUSIVE_READ | |
193 base::PLATFORM_FILE_EXCLUSIVE_WRITE | | 193 base::PLATFORM_FILE_EXCLUSIVE_WRITE | |
194 base::PLATFORM_FILE_ASYNC | | 194 base::PLATFORM_FILE_ASYNC | |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 } | 689 } |
690 } | 690 } |
691 return false; | 691 return false; |
692 } | 692 } |
693 | 693 |
694 WorkerProcessHost::WorkerInstance::SenderInfo | 694 WorkerProcessHost::WorkerInstance::SenderInfo |
695 WorkerProcessHost::WorkerInstance::GetSender() const { | 695 WorkerProcessHost::WorkerInstance::GetSender() const { |
696 DCHECK(NumSenders() == 1); | 696 DCHECK(NumSenders() == 1); |
697 return *senders_.begin(); | 697 return *senders_.begin(); |
698 } | 698 } |
OLD | NEW |