Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: webkit/fileapi/local_file_system_operation.cc

Issue 10870060: Removed calls to URLRequest::URLRequest in favor of URLRequestContext::CreateRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 return; 306 return;
307 } 307 }
308 308
309 DCHECK(blob_url.is_valid()); 309 DCHECK(blob_url.is_valid());
310 file_writer_delegate_.reset(new FileWriterDelegate( 310 file_writer_delegate_.reset(new FileWriterDelegate(
311 base::Bind(&LocalFileSystemOperation::DidWrite, 311 base::Bind(&LocalFileSystemOperation::DidWrite,
312 weak_factory_.GetWeakPtr()), 312 weak_factory_.GetWeakPtr()),
313 writer.Pass())); 313 writer.Pass()));
314 314
315 set_write_callback(callback); 315 set_write_callback(callback);
316 scoped_ptr<net::URLRequest> blob_request( 316 scoped_ptr<net::URLRequest> blob_request(url_request_context->CreateRequest(
317 new net::URLRequest(blob_url, 317 blob_url, file_writer_delegate_.get()));
318 file_writer_delegate_.get(),
319 url_request_context));
320 318
321 file_writer_delegate_->Start(blob_request.Pass()); 319 file_writer_delegate_->Start(blob_request.Pass());
322 } 320 }
323 321
324 void LocalFileSystemOperation::Truncate(const FileSystemURL& url, int64 length, 322 void LocalFileSystemOperation::Truncate(const FileSystemURL& url, int64 length,
325 const StatusCallback& callback) { 323 const StatusCallback& callback) {
326 DCHECK(SetPendingOperationType(kOperationTruncate)); 324 DCHECK(SetPendingOperationType(kOperationTruncate));
327 325
328 base::PlatformFileError result = SetUp(url, &src_util_, SETUP_FOR_WRITE); 326 base::PlatformFileError result = SetUp(url, &src_util_, SETUP_FOR_WRITE);
329 if (result != base::PLATFORM_FILE_OK) { 327 if (result != base::PLATFORM_FILE_OK) {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 765 }
768 766
769 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { 767 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) {
770 if (pending_operation_ != kOperationNone) 768 if (pending_operation_ != kOperationNone)
771 return false; 769 return false;
772 pending_operation_ = type; 770 pending_operation_ = type;
773 return true; 771 return true;
774 } 772 }
775 773
776 } // namespace fileapi 774 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_writer_delegate_unittest.cc ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698