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

Side by Side Diff: content/browser/renderer_host/resource_loader.cc

Issue 10831302: Download resumption - Preliminary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed signed/unsigned compare issue. Created 8 years 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 "content/browser/renderer_host/resource_loader.h" 5 #include "content/browser/renderer_host/resource_loader.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/renderer_host/doomed_resource_handler.h" 10 #include "content/browser/renderer_host/doomed_resource_handler.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (request_->status().is_success()) { 322 if (request_->status().is_success()) {
323 StartReading(false); // Read the first chunk. 323 StartReading(false); // Read the first chunk.
324 } else { 324 } else {
325 ResponseCompleted(); 325 ResponseCompleted();
326 } 326 }
327 } 327 }
328 328
329 void ResourceLoader::OnReadCompleted(net::URLRequest* unused, int bytes_read) { 329 void ResourceLoader::OnReadCompleted(net::URLRequest* unused, int bytes_read) {
330 DCHECK_EQ(request_.get(), unused); 330 DCHECK_EQ(request_.get(), unused);
331 VLOG(1) << "OnReadCompleted: \"" << request_->url().spec() << "\"" 331 VLOG(1) << "OnReadCompleted: \"" << request_->url().spec() << "\""
332 << " bytes_read = " << bytes_read; 332 << " bytes_read = " << bytes_read
333 << " error = " << request_->status().error()
334 << " status = " << request_->status().status();
333 335
334 // bytes_read == -1 always implies an error. 336 // bytes_read == -1 always implies an error.
335 if (bytes_read == -1 || !request_->status().is_success()) { 337 if (bytes_read == -1 || !request_->status().is_success()) {
336 ResponseCompleted(); 338 ResponseCompleted();
337 return; 339 return;
338 } 340 }
339 341
340 CompleteRead(bytes_read); 342 CompleteRead(bytes_read);
341 343
342 if (is_deferred()) 344 if (is_deferred())
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 // we resume. 575 // we resume.
574 deferred_stage_ = DEFERRED_FINISH; 576 deferred_stage_ = DEFERRED_FINISH;
575 } 577 }
576 } 578 }
577 579
578 void ResourceLoader::CallDidFinishLoading() { 580 void ResourceLoader::CallDidFinishLoading() {
579 delegate_->DidFinishLoading(this); 581 delegate_->DidFinishLoading(this);
580 } 582 }
581 583
582 } // namespace content 584 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_impl.cc ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698