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 20 matching lines...) Expand all Loading... |
31 #include "content/browser/worker_host/message_port_service.h" | 31 #include "content/browser/worker_host/message_port_service.h" |
32 #include "content/browser/worker_host/worker_message_filter.h" | 32 #include "content/browser/worker_host/worker_message_filter.h" |
33 #include "content/browser/worker_host/worker_service.h" | 33 #include "content/browser/worker_host/worker_service.h" |
34 #include "content/common/debug_flags.h" | 34 #include "content/common/debug_flags.h" |
35 #include "content/common/result_codes.h" | 35 #include "content/common/result_codes.h" |
36 #include "content/common/view_messages.h" | 36 #include "content/common/view_messages.h" |
37 #include "content/common/worker_messages.h" | 37 #include "content/common/worker_messages.h" |
38 #include "net/base/mime_util.h" | 38 #include "net/base/mime_util.h" |
39 #include "ipc/ipc_switches.h" | 39 #include "ipc/ipc_switches.h" |
40 #include "net/base/registry_controlled_domain.h" | 40 #include "net/base/registry_controlled_domain.h" |
| 41 #include "webkit/fileapi/file_system_path_manager.h" |
| 42 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
41 #include "webkit/glue/resource_type.h" | 43 #include "webkit/glue/resource_type.h" |
42 #include "webkit/fileapi/file_system_path_manager.h" | |
43 | 44 |
44 namespace { | 45 namespace { |
45 | 46 |
46 // Helper class that we pass to SocketStreamDispatcherHost so that it can find | 47 // Helper class that we pass to SocketStreamDispatcherHost so that it can find |
47 // the right net::URLRequestContext for a request. | 48 // the right net::URLRequestContext for a request. |
48 class URLRequestContextOverride | 49 class URLRequestContextOverride |
49 : public ResourceMessageFilter::URLRequestContextOverride { | 50 : public ResourceMessageFilter::URLRequestContextOverride { |
50 public: | 51 public: |
51 explicit URLRequestContextOverride( | 52 explicit URLRequestContextOverride( |
52 net::URLRequestContext* url_request_context) | 53 net::URLRequestContext* url_request_context) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 176 ChildProcessSecurityPolicy::GetInstance()->Add(id()); |
176 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 177 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
177 switches::kDisableFileSystem)) { | 178 switches::kDisableFileSystem)) { |
178 // Grant most file permissions to this worker. | 179 // Grant most file permissions to this worker. |
179 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 180 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
180 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 181 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
181 // requests them. | 182 // requests them. |
182 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 183 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
183 id(), | 184 id(), |
184 GetChromeURLRequestContext()->file_system_context()-> | 185 GetChromeURLRequestContext()->file_system_context()-> |
185 path_manager()->base_path(), | 186 path_manager()->sandbox_provider()->base_path(), |
186 base::PLATFORM_FILE_OPEN | | 187 base::PLATFORM_FILE_OPEN | |
187 base::PLATFORM_FILE_CREATE | | 188 base::PLATFORM_FILE_CREATE | |
188 base::PLATFORM_FILE_OPEN_ALWAYS | | 189 base::PLATFORM_FILE_OPEN_ALWAYS | |
189 base::PLATFORM_FILE_CREATE_ALWAYS | | 190 base::PLATFORM_FILE_CREATE_ALWAYS | |
190 base::PLATFORM_FILE_READ | | 191 base::PLATFORM_FILE_READ | |
191 base::PLATFORM_FILE_WRITE | | 192 base::PLATFORM_FILE_WRITE | |
192 base::PLATFORM_FILE_EXCLUSIVE_READ | | 193 base::PLATFORM_FILE_EXCLUSIVE_READ | |
193 base::PLATFORM_FILE_EXCLUSIVE_WRITE | | 194 base::PLATFORM_FILE_EXCLUSIVE_WRITE | |
194 base::PLATFORM_FILE_ASYNC | | 195 base::PLATFORM_FILE_ASYNC | |
195 base::PLATFORM_FILE_TRUNCATE | | 196 base::PLATFORM_FILE_TRUNCATE | |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 } | 603 } |
603 } | 604 } |
604 return false; | 605 return false; |
605 } | 606 } |
606 | 607 |
607 WorkerProcessHost::WorkerInstance::FilterInfo | 608 WorkerProcessHost::WorkerInstance::FilterInfo |
608 WorkerProcessHost::WorkerInstance::GetFilter() const { | 609 WorkerProcessHost::WorkerInstance::GetFilter() const { |
609 DCHECK(NumFilters() == 1); | 610 DCHECK(NumFilters() == 1); |
610 return *filters_.begin(); | 611 return *filters_.begin(); |
611 } | 612 } |
OLD | NEW |