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/fileapi/sandbox_mount_point_provider.h" | 5 #include "webkit/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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 return false; | 435 return false; |
436 } | 436 } |
437 | 437 |
438 FileSystemFileUtil* SandboxMountPointProvider::GetFileUtil( | 438 FileSystemFileUtil* SandboxMountPointProvider::GetFileUtil( |
439 FileSystemType type) { | 439 FileSystemType type) { |
440 return sandbox_file_util_.get(); | 440 return sandbox_file_util_.get(); |
441 } | 441 } |
442 | 442 |
443 FilePath SandboxMountPointProvider::GetPathForPermissionsCheck( | 443 FilePath SandboxMountPointProvider::GetPathForPermissionsCheck( |
444 const FilePath& virtual_path) const { | 444 const FilePath& virtual_path) const { |
445 // We simply return the very top directory of the sandbox | 445 // Sandbox provider shouldn't directly grant permissions for its |
446 // filesystem regardless of the input path. | 446 // data directory. |
447 return new_base_path(); | 447 return FilePath(); |
448 } | 448 } |
449 | 449 |
450 FileSystemOperation* SandboxMountPointProvider::CreateFileSystemOperation( | 450 FileSystemOperation* SandboxMountPointProvider::CreateFileSystemOperation( |
451 const FileSystemURL& url, | 451 const FileSystemURL& url, |
452 FileSystemContext* context, | 452 FileSystemContext* context, |
453 base::PlatformFileError* error_code) const { | 453 base::PlatformFileError* error_code) const { |
454 scoped_ptr<FileSystemOperationContext> operation_context( | 454 scoped_ptr<FileSystemOperationContext> operation_context( |
455 new FileSystemOperationContext(context)); | 455 new FileSystemOperationContext(context)); |
456 | 456 |
457 // Copy the observer lists (assuming we only have small number of observers). | 457 // Copy the observer lists (assuming we only have small number of observers). |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 i < file_system_options_.additional_allowed_schemes().size(); | 774 i < file_system_options_.additional_allowed_schemes().size(); |
775 ++i) { | 775 ++i) { |
776 if (url.SchemeIs( | 776 if (url.SchemeIs( |
777 file_system_options_.additional_allowed_schemes()[i].c_str())) | 777 file_system_options_.additional_allowed_schemes()[i].c_str())) |
778 return true; | 778 return true; |
779 } | 779 } |
780 return false; | 780 return false; |
781 } | 781 } |
782 | 782 |
783 } // namespace fileapi | 783 } // namespace fileapi |
OLD | NEW |