| 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/file_system_operation.h" | 5 #include "webkit/fileapi/file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/sequenced_task_runner.h" | 8 #include "base/sequenced_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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 SetUpMode mode) { | 676 SetUpMode mode) { |
| 677 if (!url.is_valid()) | 677 if (!url.is_valid()) |
| 678 return base::PLATFORM_FILE_ERROR_INVALID_URL; | 678 return base::PLATFORM_FILE_ERROR_INVALID_URL; |
| 679 | 679 |
| 680 if (!file_system_context()->GetMountPointProvider( | 680 if (!file_system_context()->GetMountPointProvider( |
| 681 url.type())->IsAccessAllowed(url.origin(), url.type(), url.path())) | 681 url.type())->IsAccessAllowed(url.origin(), url.type(), url.path())) |
| 682 return base::PLATFORM_FILE_ERROR_SECURITY; | 682 return base::PLATFORM_FILE_ERROR_SECURITY; |
| 683 | 683 |
| 684 DCHECK(file_util); | 684 DCHECK(file_util); |
| 685 if (!*file_util) | 685 if (!*file_util) |
| 686 *file_util = file_system_context()->GetFileUtil(url.type()); | 686 *file_util = file_system_context()->GetFileUtil(url); |
| 687 if (!*file_util) | 687 if (!*file_util) |
| 688 return base::PLATFORM_FILE_ERROR_SECURITY; | 688 return base::PLATFORM_FILE_ERROR_SECURITY; |
| 689 | 689 |
| 690 if (mode == SETUP_FOR_READ) { | 690 if (mode == SETUP_FOR_READ) { |
| 691 // We notify this read access whether the read access succeeds or not. | 691 // We notify this read access whether the read access succeeds or not. |
| 692 // This must be ok since this is used to let the QM's eviction logic know | 692 // This must be ok since this is used to let the QM's eviction logic know |
| 693 // someone is interested in reading the origin data and therefore to | 693 // someone is interested in reading the origin data and therefore to |
| 694 // indicate that evicting this origin may not be a good idea. | 694 // indicate that evicting this origin may not be a good idea. |
| 695 FileSystemQuotaUtil* quota_util = file_system_context()->GetQuotaUtil( | 695 FileSystemQuotaUtil* quota_util = file_system_context()->GetQuotaUtil( |
| 696 url.type()); | 696 url.type()); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 722 } | 722 } |
| 723 | 723 |
| 724 bool FileSystemOperation::SetPendingOperationType(OperationType type) { | 724 bool FileSystemOperation::SetPendingOperationType(OperationType type) { |
| 725 if (pending_operation_ != kOperationNone) | 725 if (pending_operation_ != kOperationNone) |
| 726 return false; | 726 return false; |
| 727 pending_operation_ = type; | 727 pending_operation_ = type; |
| 728 return true; | 728 return true; |
| 729 } | 729 } |
| 730 | 730 |
| 731 } // namespace fileapi | 731 } // namespace fileapi |
| OLD | NEW |