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

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

Issue 10559036: Added URLRequestContext to constructor for URLRequest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated unittests Created 8 years, 6 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
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/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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 DCHECK(blob_url.is_valid()); 290 DCHECK(blob_url.is_valid());
291 file_writer_delegate_.reset(new FileWriterDelegate( 291 file_writer_delegate_.reset(new FileWriterDelegate(
292 base::Bind(&FileSystemOperation::DidWrite, weak_factory_.GetWeakPtr()), 292 base::Bind(&FileSystemOperation::DidWrite, weak_factory_.GetWeakPtr()),
293 scoped_ptr<FileStreamWriter>( 293 scoped_ptr<FileStreamWriter>(
294 new SandboxFileStreamWriter(file_system_context(), 294 new SandboxFileStreamWriter(file_system_context(),
295 path_url, 295 path_url,
296 offset)))); 296 offset))));
297 set_write_callback(callback); 297 set_write_callback(callback);
298 scoped_ptr<net::URLRequest> blob_request( 298 scoped_ptr<net::URLRequest> blob_request(
299 new net::URLRequest(blob_url, file_writer_delegate_.get())); 299 new net::URLRequest(blob_url,
300 blob_request->set_context(url_request_context); 300 file_writer_delegate_.get(),
301 url_request_context));
301 302
302 file_writer_delegate_->Start(blob_request.Pass()); 303 file_writer_delegate_->Start(blob_request.Pass());
303 } 304 }
304 305
305 void FileSystemOperation::Truncate(const GURL& path_url, int64 length, 306 void FileSystemOperation::Truncate(const GURL& path_url, int64 length,
306 const StatusCallback& callback) { 307 const StatusCallback& callback) {
307 DCHECK(SetPendingOperationType(kOperationTruncate)); 308 DCHECK(SetPendingOperationType(kOperationTruncate));
308 309
309 base::PlatformFileError result = SetUpFileSystemPath( 310 base::PlatformFileError result = SetUpFileSystemPath(
310 path_url, &src_path_, &src_util_, PATH_FOR_WRITE); 311 path_url, &src_path_, &src_util_, PATH_FOR_WRITE);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 } 716 }
716 717
717 bool FileSystemOperation::SetPendingOperationType(OperationType type) { 718 bool FileSystemOperation::SetPendingOperationType(OperationType type) {
718 if (pending_operation_ != kOperationNone) 719 if (pending_operation_ != kOperationNone)
719 return false; 720 return false;
720 pending_operation_ = type; 721 pending_operation_ = type;
721 return true; 722 return true;
722 } 723 }
723 724
724 } // namespace fileapi 725 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698