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

Side by Side Diff: net/url_request/url_request.cc

Issue 19004: Change URLRequest to use a ref-counted buffer for actual IO.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « net/url_request/url_request.h ('k') | net/url_request/url_request_file_dir_job.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "net/url_request/url_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 status_.set_os_error(os_error); 245 status_.set_os_error(os_error);
246 } 246 }
247 247
248 job_->Kill(); 248 job_->Kill();
249 249
250 // The Job will call our NotifyDone method asynchronously. This is done so 250 // The Job will call our NotifyDone method asynchronously. This is done so
251 // that the Delegate implementation can call Cancel without having to worry 251 // that the Delegate implementation can call Cancel without having to worry
252 // about being called recursively. 252 // about being called recursively.
253 } 253 }
254 254
255 bool URLRequest::Read(char* dest, int dest_size, int *bytes_read) { 255 bool URLRequest::Read(net::IOBuffer* dest, int dest_size, int *bytes_read) {
256 DCHECK(job_); 256 DCHECK(job_);
257 DCHECK(bytes_read); 257 DCHECK(bytes_read);
258 DCHECK(!job_->is_done()); 258 DCHECK(!job_->is_done());
259 *bytes_read = 0; 259 *bytes_read = 0;
260 260
261 if (dest_size == 0) { 261 if (dest_size == 0) {
262 // Caller is not too bright. I guess we've done what they asked. 262 // Caller is not too bright. I guess we've done what they asked.
263 return true; 263 return true;
264 } 264 }
265 265
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 return net::OK; 377 return net::OK;
378 } 378 }
379 379
380 int64 URLRequest::GetExpectedContentSize() const { 380 int64 URLRequest::GetExpectedContentSize() const {
381 int64 expected_content_size = -1; 381 int64 expected_content_size = -1;
382 if (job_) 382 if (job_)
383 expected_content_size = job_->expected_content_size(); 383 expected_content_size = job_->expected_content_size();
384 384
385 return expected_content_size; 385 return expected_content_size;
386 } 386 }
OLDNEW
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_file_dir_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698