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 "content/browser/fileapi/fileapi_message_filter.h" | 5 #include "content/browser/fileapi/fileapi_message_filter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
750 // that the renderer can read the file's platform path. If this is the case | 750 // that the renderer can read the file's platform path. If this is the case |
751 // the renderer should be granted read permission for the file's platform | 751 // the renderer should be granted read permission for the file's platform |
752 // path. This can happen in the following situations: | 752 // path. This can happen in the following situations: |
753 // - the file comes from sandboxed filesystem. Reading sandboxed files is | 753 // - the file comes from sandboxed filesystem. Reading sandboxed files is |
754 // always permitted, but only implicitly. | 754 // always permitted, but only implicitly. |
755 // - the underlying filesystem returned newly created snapshot file. | 755 // - the underlying filesystem returned newly created snapshot file. |
756 // - the nominal path differs from the platform path. This can happen even | 756 // - the nominal path differs from the platform path. This can happen even |
757 // when the filesystem has been granted permissions. This happens with: | 757 // when the filesystem has been granted permissions. This happens with: |
758 // - Drive filesystems | 758 // - Drive filesystems |
759 // - Picasa filesystems | 759 // - Picasa filesystems |
760 // - iTunes filesystems | |
760 DCHECK(snapshot_file.get() || | 761 DCHECK(snapshot_file.get() || |
761 fileapi::SandboxMountPointProvider::IsSandboxType(url.type()) || | 762 fileapi::SandboxMountPointProvider::IsSandboxType(url.type()) || |
762 url.type() == fileapi::kFileSystemTypeDrive || | 763 url.type() == fileapi::kFileSystemTypeDrive || |
763 url.type() == fileapi::kFileSystemTypePicasa); | 764 url.type() == fileapi::kFileSystemTypePicasa || |
765 url.type() == fileapi::kFileSystemTypeItunes); | |
kinuko
2013/06/07 05:45:13
Hmm, this part seems to need some cleanup...
| |
764 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 766 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
765 process_id_, platform_path); | 767 process_id_, platform_path); |
766 if (snapshot_file.get()) { | 768 if (snapshot_file.get()) { |
767 // This will revoke all permissions for the file when the last ref | 769 // This will revoke all permissions for the file when the last ref |
768 // of the file is dropped (assuming it's ok). | 770 // of the file is dropped (assuming it's ok). |
769 snapshot_file->AddFinalReleaseCallback( | 771 snapshot_file->AddFinalReleaseCallback( |
770 base::Bind(&RevokeFilePermission, process_id_)); | 772 base::Bind(&RevokeFilePermission, process_id_)); |
771 } | 773 } |
772 } | 774 } |
773 | 775 |
(...skipping 23 matching lines...) Expand all Loading... | |
797 Send(new FileSystemMsg_DidFail(request_id, error_code)); | 799 Send(new FileSystemMsg_DidFail(request_id, error_code)); |
798 return NULL; | 800 return NULL; |
799 } | 801 } |
800 | 802 |
801 DCHECK(operation); | 803 DCHECK(operation); |
802 operations_.AddWithID(operation, request_id); | 804 operations_.AddWithID(operation, request_id); |
803 return operation; | 805 return operation; |
804 } | 806 } |
805 | 807 |
806 } // namespace content | 808 } // namespace content |
OLD | NEW |