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/local_file_system_operation.h" | 5 #include "webkit/fileapi/local_file_system_operation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 | 716 |
717 base::PlatformFileError LocalFileSystemOperation::SetUp( | 717 base::PlatformFileError LocalFileSystemOperation::SetUp( |
718 const FileSystemURL& url, | 718 const FileSystemURL& url, |
719 FileSystemFileUtil** file_util, | 719 FileSystemFileUtil** file_util, |
720 SetUpMode mode) { | 720 SetUpMode mode) { |
721 if (!url.is_valid()) | 721 if (!url.is_valid()) |
722 return base::PLATFORM_FILE_ERROR_INVALID_URL; | 722 return base::PLATFORM_FILE_ERROR_INVALID_URL; |
723 | 723 |
724 if (!file_system_context()->GetMountPointProvider( | 724 if (!file_system_context()->GetMountPointProvider( |
725 url.type())->IsAccessAllowed(url.origin(), url.type(), | 725 url.type())->IsAccessAllowed(url)) |
726 url.virtual_path())) | |
727 return base::PLATFORM_FILE_ERROR_SECURITY; | 726 return base::PLATFORM_FILE_ERROR_SECURITY; |
728 | 727 |
729 DCHECK(file_util); | 728 DCHECK(file_util); |
730 if (!*file_util) | 729 if (!*file_util) |
731 *file_util = file_system_context()->GetFileUtil(url.type()); | 730 *file_util = file_system_context()->GetFileUtil(url.type()); |
732 if (!*file_util) | 731 if (!*file_util) |
733 return base::PLATFORM_FILE_ERROR_SECURITY; | 732 return base::PLATFORM_FILE_ERROR_SECURITY; |
734 | 733 |
735 if (mode == SETUP_FOR_READ) { | 734 if (mode == SETUP_FOR_READ) { |
736 // We notify this read access whether the read access succeeds or not. | 735 // We notify this read access whether the read access succeeds or not. |
(...skipping 30 matching lines...) Expand all Loading... |
767 } | 766 } |
768 | 767 |
769 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { | 768 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { |
770 if (pending_operation_ != kOperationNone) | 769 if (pending_operation_ != kOperationNone) |
771 return false; | 770 return false; |
772 pending_operation_ = type; | 771 pending_operation_ = type; |
773 return true; | 772 return true; |
774 } | 773 } |
775 | 774 |
776 } // namespace fileapi | 775 } // namespace fileapi |
OLD | NEW |