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

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

Issue 13811013: Refactor FileSystemMountPointProvider::CreateFileStream{Reader,Writer} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: conflict fix Created 7 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
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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 if (is_directory_) { 195 if (is_directory_) {
196 NotifyHeadersComplete(); 196 NotifyHeadersComplete();
197 return; 197 return;
198 } 198 }
199 199
200 remaining_bytes_ = byte_range_.last_byte_position() - 200 remaining_bytes_ = byte_range_.last_byte_position() -
201 byte_range_.first_byte_position() + 1; 201 byte_range_.first_byte_position() + 1;
202 DCHECK_GE(remaining_bytes_, 0); 202 DCHECK_GE(remaining_bytes_, 0);
203 203
204 DCHECK(!reader_.get()); 204 DCHECK(!reader_.get());
205 reader_.reset( 205 reader_ = file_system_context_->CreateFileStreamReader(
206 file_system_context_->CreateFileStreamReader( 206 url_, byte_range_.first_byte_position(), base::Time());
207 url_,
208 byte_range_.first_byte_position(),
209 base::Time()));
210 207
211 set_expected_content_size(remaining_bytes_); 208 set_expected_content_size(remaining_bytes_);
212 response_info_.reset(new net::HttpResponseInfo()); 209 response_info_.reset(new net::HttpResponseInfo());
213 response_info_->headers = CreateHttpResponseHeaders(); 210 response_info_->headers = CreateHttpResponseHeaders();
214 NotifyHeadersComplete(); 211 NotifyHeadersComplete();
215 } 212 }
216 213
217 void FileSystemURLRequestJob::DidRead(int result) { 214 void FileSystemURLRequestJob::DidRead(int result) {
218 if (result > 0) 215 if (result > 0)
219 SetStatus(URLRequestStatus()); // Clear the IO_PENDING status 216 SetStatus(URLRequestStatus()); // Clear the IO_PENDING status
(...skipping 23 matching lines...) Expand all
243 } 240 }
244 241
245 return false; 242 return false;
246 } 243 }
247 244
248 void FileSystemURLRequestJob::NotifyFailed(int rv) { 245 void FileSystemURLRequestJob::NotifyFailed(int rv) {
249 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); 246 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
250 } 247 }
251 248
252 } // namespace fileapi 249 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_mount_point_provider.h ('k') | webkit/fileapi/isolated_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698