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

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

Issue 9402014: net: FileStream::Read/Write() to take IOBuffer* instead of char* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix redirect_to_file_resource_handler.cc Created 8 years, 10 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 | « webkit/blob/blob_url_request_job.cc ('k') | webkit/fileapi/file_writer_delegate.h » ('j') | 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_system_url_request_job.h" 5 #include "webkit/fileapi/file_system_url_request_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util_proxy.h" 10 #include "base/file_util_proxy.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return false; 102 return false;
103 103
104 if (remaining_bytes_ < dest_size) 104 if (remaining_bytes_ < dest_size)
105 dest_size = static_cast<int>(remaining_bytes_); 105 dest_size = static_cast<int>(remaining_bytes_);
106 106
107 if (!dest_size) { 107 if (!dest_size) {
108 *bytes_read = 0; 108 *bytes_read = 0;
109 return true; 109 return true;
110 } 110 }
111 111
112 int rv = stream_->Read(dest->data(), dest_size, 112 int rv = stream_->Read(dest, dest_size,
113 base::Bind(&FileSystemURLRequestJob::DidRead, 113 base::Bind(&FileSystemURLRequestJob::DidRead,
114 base::Unretained(this))); 114 base::Unretained(this)));
115 if (rv >= 0) { 115 if (rv >= 0) {
116 // Data is immediately available. 116 // Data is immediately available.
117 *bytes_read = rv; 117 *bytes_read = rv;
118 remaining_bytes_ -= rv; 118 remaining_bytes_ -= rv;
119 DCHECK_GE(remaining_bytes_, 0); 119 DCHECK_GE(remaining_bytes_, 0);
120 return true; 120 return true;
121 } 121 }
122 122
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 280
281 return false; 281 return false;
282 } 282 }
283 283
284 void FileSystemURLRequestJob::NotifyFailed(int rv) { 284 void FileSystemURLRequestJob::NotifyFailed(int rv) {
285 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); 285 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
286 } 286 }
287 287
288 } // namespace fileapi 288 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/blob/blob_url_request_job.cc ('k') | webkit/fileapi/file_writer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698