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

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

Issue 10008047: FileWriterDelegate should not call URLRequest::Start() after Cancel(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_writer_delegate.h" 5 #include "webkit/fileapi/file_writer_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util_proxy.h" 9 #include "base/file_util_proxy.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 FileWriterDelegate::~FileWriterDelegate() { 107 FileWriterDelegate::~FileWriterDelegate() {
108 } 108 }
109 109
110 void FileWriterDelegate::OnGetFileInfoAndCallStartUpdate( 110 void FileWriterDelegate::OnGetFileInfoAndCallStartUpdate(
111 base::PlatformFileError error, 111 base::PlatformFileError error,
112 const base::PlatformFileInfo& file_info) { 112 const base::PlatformFileInfo& file_info) {
113 if (error) { 113 if (error) {
114 OnError(error); 114 OnError(error);
115 return; 115 return;
116 } 116 }
117 if (request_->status().status() == net::URLRequestStatus::CANCELED) {
ericu 2012/04/09 16:14:22 This looks more like "Don't call Start after Cance
118 OnError(base::PLATFORM_FILE_ERROR_ABORT);
119 return;
120 }
117 int64 allowed_bytes_growth = 121 int64 allowed_bytes_growth =
118 file_system_operation_context()->allowed_bytes_growth(); 122 file_system_operation_context()->allowed_bytes_growth();
119 if (allowed_bytes_growth < 0) 123 if (allowed_bytes_growth < 0)
120 allowed_bytes_growth = 0; 124 allowed_bytes_growth = 0;
121 int64 overlap = file_info.size - offset_; 125 int64 overlap = file_info.size - offset_;
122 allowed_bytes_to_write_ = allowed_bytes_growth; 126 allowed_bytes_to_write_ = allowed_bytes_growth;
123 if (kint64max - overlap > allowed_bytes_growth) 127 if (kint64max - overlap > allowed_bytes_growth)
124 allowed_bytes_to_write_ += overlap; 128 allowed_bytes_to_write_ += overlap;
125 size_ = file_info.size; 129 size_ = file_info.size;
126 file_stream_.reset(new net::FileStream( 130 file_stream_.reset(new net::FileStream(
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 323
320 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { 324 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const {
321 DCHECK(file_system_operation_); 325 DCHECK(file_system_operation_);
322 DCHECK(file_system_operation_->file_system_context()); 326 DCHECK(file_system_operation_->file_system_context());
323 DCHECK(file_system_operation_->file_system_operation_context()); 327 DCHECK(file_system_operation_->file_system_operation_context());
324 return file_system_operation_->file_system_context()->GetQuotaUtil( 328 return file_system_operation_->file_system_context()->GetQuotaUtil(
325 path_.type()); 329 path_.type());
326 } 330 }
327 331
328 } // namespace fileapi 332 } // namespace fileapi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698