| OLD | NEW |
| 1 // Copyright (c) 2010 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 "net/url_request/url_request_context.h" | 8 #include "net/url_request/url_request_context.h" |
| 9 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 9 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 10 #include "webkit/fileapi/file_writer_delegate.h" | 10 #include "webkit/fileapi/file_writer_delegate.h" |
| 11 | 11 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 DCHECK(kOperationNone == pending_operation_); | 124 DCHECK(kOperationNone == pending_operation_); |
| 125 pending_operation_ = kOperationRemove; | 125 pending_operation_ = kOperationRemove; |
| 126 #endif | 126 #endif |
| 127 | 127 |
| 128 base::FileUtilProxy::Delete(proxy_, path, recursive, | 128 base::FileUtilProxy::Delete(proxy_, path, recursive, |
| 129 callback_factory_.NewCallback( | 129 callback_factory_.NewCallback( |
| 130 &FileSystemOperation::DidFinishFileOperation)); | 130 &FileSystemOperation::DidFinishFileOperation)); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void FileSystemOperation::Write( | 133 void FileSystemOperation::Write( |
| 134 scoped_refptr<URLRequestContext> url_request_context, | 134 scoped_refptr<net::URLRequestContext> url_request_context, |
| 135 const FilePath& path, | 135 const FilePath& path, |
| 136 const GURL& blob_url, | 136 const GURL& blob_url, |
| 137 int64 offset) { | 137 int64 offset) { |
| 138 #ifndef NDEBUG | 138 #ifndef NDEBUG |
| 139 DCHECK(kOperationNone == pending_operation_); | 139 DCHECK(kOperationNone == pending_operation_); |
| 140 pending_operation_ = kOperationWrite; | 140 pending_operation_ = kOperationWrite; |
| 141 #endif | 141 #endif |
| 142 DCHECK(blob_url.is_valid()); | 142 DCHECK(blob_url.is_valid()); |
| 143 file_writer_delegate_.reset(new FileWriterDelegate(this, offset)); | 143 file_writer_delegate_.reset(new FileWriterDelegate(this, offset)); |
| 144 blob_request_.reset( | 144 blob_request_.reset( |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 void FileSystemOperation::DidTouchFile(base::PlatformFileError rv) { | 315 void FileSystemOperation::DidTouchFile(base::PlatformFileError rv) { |
| 316 if (rv == base::PLATFORM_FILE_OK) | 316 if (rv == base::PLATFORM_FILE_OK) |
| 317 dispatcher_->DidSucceed(); | 317 dispatcher_->DidSucceed(); |
| 318 else | 318 else |
| 319 dispatcher_->DidFail(rv); | 319 dispatcher_->DidFail(rv); |
| 320 delete this; | 320 delete this; |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace fileapi | 323 } // namespace fileapi |
| OLD | NEW |