| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/time.h" | 7 #include "base/time.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "net/base/escape.h" | 9 #include "net/base/escape.h" |
| 10 #include "net/url_request/url_request_context.h" | 10 #include "net/url_request/url_request_context.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 DCHECK(file_system_context()); | 54 DCHECK(file_system_context()); |
| 55 file_system_operation_context_.set_src_origin_url(origin_url); | 55 file_system_operation_context_.set_src_origin_url(origin_url); |
| 56 file_system_operation_context_.set_src_type(type); | 56 file_system_operation_context_.set_src_type(type); |
| 57 // TODO(ericu): We don't really need to make this call if !create. | 57 // TODO(ericu): We don't really need to make this call if !create. |
| 58 // Also, in the future we won't need it either way, as long as we do all | 58 // Also, in the future we won't need it either way, as long as we do all |
| 59 // permission+quota checks beforehand. We only need it now because we have to | 59 // permission+quota checks beforehand. We only need it now because we have to |
| 60 // create an unpredictable directory name. Without that, we could lazily | 60 // create an unpredictable directory name. Without that, we could lazily |
| 61 // create the root later on the first filesystem write operation, and just | 61 // create the root later on the first filesystem write operation, and just |
| 62 // return GetFileSystemRootURI() here. | 62 // return GetFileSystemRootURI() here. |
| 63 file_system_context()->path_manager()->GetFileSystemRootPath( | 63 file_system_context()->path_manager()->GetFileSystemRootPath( |
| 64 origin_url, type, create, | 64 origin_url, type, create, true, FilePath(), |
| 65 callback_factory_.NewCallback(&FileSystemOperation::DidGetRootPath)); | 65 callback_factory_.NewCallback(&FileSystemOperation::DidGetRootPath)); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void FileSystemOperation::CreateFile(const GURL& path, | 68 void FileSystemOperation::CreateFile(const GURL& path, |
| 69 bool exclusive) { | 69 bool exclusive) { |
| 70 #ifndef NDEBUG | 70 #ifndef NDEBUG |
| 71 DCHECK(kOperationNone == pending_operation_); | 71 DCHECK(kOperationNone == pending_operation_); |
| 72 pending_operation_ = kOperationCreateFile; | 72 pending_operation_ = kOperationCreateFile; |
| 73 #endif | 73 #endif |
| 74 FilePath virtual_path; | 74 FilePath virtual_path; |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 } | 681 } |
| 682 // TODO(kinuko): the check must be moved to QuotaFileSystemFileUtil. | 682 // TODO(kinuko): the check must be moved to QuotaFileSystemFileUtil. |
| 683 if (!file_system_context()->IsStorageUnlimited(*origin_url)) { | 683 if (!file_system_context()->IsStorageUnlimited(*origin_url)) { |
| 684 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NO_SPACE); | 684 dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_NO_SPACE); |
| 685 return false; | 685 return false; |
| 686 } | 686 } |
| 687 return true; | 687 return true; |
| 688 } | 688 } |
| 689 | 689 |
| 690 } // namespace fileapi | 690 } // namespace fileapi |
| OLD | NEW |