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 "webkit/browser/fileapi/sandbox_mount_point_provider.h" | 5 #include "webkit/browser/fileapi/sandbox_mount_point_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 CopyOrMoveFileValidatorFactory* | 273 CopyOrMoveFileValidatorFactory* |
274 SandboxMountPointProvider::GetCopyOrMoveFileValidatorFactory( | 274 SandboxMountPointProvider::GetCopyOrMoveFileValidatorFactory( |
275 FileSystemType type, | 275 FileSystemType type, |
276 base::PlatformFileError* error_code) { | 276 base::PlatformFileError* error_code) { |
277 DCHECK(error_code); | 277 DCHECK(error_code); |
278 *error_code = base::PLATFORM_FILE_OK; | 278 *error_code = base::PLATFORM_FILE_OK; |
279 return NULL; | 279 return NULL; |
280 } | 280 } |
281 | 281 |
282 void SandboxMountPointProvider::InitializeCopyOrMoveFileValidatorFactory( | |
283 FileSystemType type, | |
284 scoped_ptr<CopyOrMoveFileValidatorFactory> factory) { | |
285 DCHECK(!factory); | |
286 } | |
287 | |
288 FilePermissionPolicy SandboxMountPointProvider::GetPermissionPolicy( | 282 FilePermissionPolicy SandboxMountPointProvider::GetPermissionPolicy( |
289 const FileSystemURL& url, int permissions) const { | 283 const FileSystemURL& url, int permissions) const { |
290 if (!CanHandleType(url.type()) || !IsAllowedScheme(url.origin())) | 284 if (!CanHandleType(url.type()) || !IsAllowedScheme(url.origin())) |
291 return FILE_PERMISSION_ALWAYS_DENY; | 285 return FILE_PERMISSION_ALWAYS_DENY; |
292 | 286 |
293 if (url.path().ReferencesParent()) | 287 if (url.path().ReferencesParent()) |
294 return FILE_PERMISSION_ALWAYS_DENY; | 288 return FILE_PERMISSION_ALWAYS_DENY; |
295 | 289 |
296 // Any write access is disallowed on the root path. | 290 // Any write access is disallowed on the root path. |
297 if ((url.path().empty() || VirtualPath::DirName(url.path()) == url.path()) | 291 if ((url.path().empty() || VirtualPath::DirName(url.path()) == url.path()) |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 685 |
692 while (!(file_path_each = enumerator->Next()).empty()) { | 686 while (!(file_path_each = enumerator->Next()).empty()) { |
693 usage += enumerator->Size(); | 687 usage += enumerator->Size(); |
694 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); | 688 usage += ObfuscatedFileUtil::ComputeFilePathCost(file_path_each); |
695 } | 689 } |
696 | 690 |
697 return usage; | 691 return usage; |
698 } | 692 } |
699 | 693 |
700 } // namespace fileapi | 694 } // namespace fileapi |
OLD | NEW |