| 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(), url.path())) | 725 url.type())->IsAccessAllowed(url)) |
| 726 return base::PLATFORM_FILE_ERROR_SECURITY; | 726 return base::PLATFORM_FILE_ERROR_SECURITY; |
| 727 | 727 |
| 728 DCHECK(file_util); | 728 DCHECK(file_util); |
| 729 if (!*file_util) | 729 if (!*file_util) |
| 730 *file_util = file_system_context()->GetFileUtil(url.type()); | 730 *file_util = file_system_context()->GetFileUtil(url.type()); |
| 731 if (!*file_util) | 731 if (!*file_util) |
| 732 return base::PLATFORM_FILE_ERROR_SECURITY; | 732 return base::PLATFORM_FILE_ERROR_SECURITY; |
| 733 | 733 |
| 734 if (mode == SETUP_FOR_READ) { | 734 if (mode == SETUP_FOR_READ) { |
| 735 // 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... |
| 766 } | 766 } |
| 767 | 767 |
| 768 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { | 768 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { |
| 769 if (pending_operation_ != kOperationNone) | 769 if (pending_operation_ != kOperationNone) |
| 770 return false; | 770 return false; |
| 771 pending_operation_ = type; | 771 pending_operation_ = type; |
| 772 return true; | 772 return true; |
| 773 } | 773 } |
| 774 | 774 |
| 775 } // namespace fileapi | 775 } // namespace fileapi |
| OLD | NEW |