| 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/chromeos/fileapi/remote_file_system_operation.h" | 5 #include "webkit/chromeos/fileapi/remote_file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 new fileapi::FileWriterDelegate( | 112 new fileapi::FileWriterDelegate( |
| 113 base::Bind(&RemoteFileSystemOperation::DidWrite, | 113 base::Bind(&RemoteFileSystemOperation::DidWrite, |
| 114 // FileWriterDelegate is owned by |this|. So Unretained. | 114 // FileWriterDelegate is owned by |this|. So Unretained. |
| 115 base::Unretained(this), | 115 base::Unretained(this), |
| 116 callback), | 116 callback), |
| 117 scoped_ptr<fileapi::FileStreamWriter>( | 117 scoped_ptr<fileapi::FileStreamWriter>( |
| 118 new fileapi::RemoteFileStreamWriter(remote_proxy_, | 118 new fileapi::RemoteFileStreamWriter(remote_proxy_, |
| 119 path, | 119 path, |
| 120 offset)))); | 120 offset)))); |
| 121 | 121 |
| 122 scoped_ptr<net::URLRequest> blob_request( | 122 scoped_ptr<net::URLRequest> blob_request(new net::URLRequest( |
| 123 new net::URLRequest(blob_url, file_writer_delegate_.get())); | 123 blob_url, file_writer_delegate_.get(), url_request_context)); |
| 124 blob_request->set_context(url_request_context); | |
| 125 | 124 |
| 126 file_writer_delegate_->Start(blob_request.Pass()); | 125 file_writer_delegate_->Start(blob_request.Pass()); |
| 127 } | 126 } |
| 128 | 127 |
| 129 void RemoteFileSystemOperation::Truncate(const GURL& path, | 128 void RemoteFileSystemOperation::Truncate(const GURL& path, |
| 130 int64 length, | 129 int64 length, |
| 131 const StatusCallback& callback) { | 130 const StatusCallback& callback) { |
| 132 DCHECK(SetPendingOperationType(kOperationTruncate)); | 131 DCHECK(SetPendingOperationType(kOperationTruncate)); |
| 133 | 132 |
| 134 remote_proxy_->Truncate(path, length, | 133 remote_proxy_->Truncate(path, length, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 263 |
| 265 void RemoteFileSystemOperation::DidOpenFile( | 264 void RemoteFileSystemOperation::DidOpenFile( |
| 266 const OpenFileCallback& callback, | 265 const OpenFileCallback& callback, |
| 267 base::PlatformFileError result, | 266 base::PlatformFileError result, |
| 268 base::PlatformFile file, | 267 base::PlatformFile file, |
| 269 base::ProcessHandle peer_handle) { | 268 base::ProcessHandle peer_handle) { |
| 270 callback.Run(result, file, peer_handle); | 269 callback.Run(result, file, peer_handle); |
| 271 } | 270 } |
| 272 | 271 |
| 273 } // namespace chromeos | 272 } // namespace chromeos |
| OLD | NEW |