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

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

Issue 10332130: Use defer out-params instead of ResourceDispatcherHostImpl::PauseRequest(...true) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 "content/browser/renderer_host/layered_resource_handler.h" 5 #include "content/browser/renderer_host/layered_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 LayeredResourceHandler::LayeredResourceHandler(ResourceHandler* next_handler) 11 LayeredResourceHandler::LayeredResourceHandler(ResourceHandler* next_handler)
12 : next_handler_(next_handler) { 12 : next_handler_(next_handler) {
13 } 13 }
14 14
15 bool LayeredResourceHandler::OnUploadProgress(int request_id, uint64 position, 15 bool LayeredResourceHandler::OnUploadProgress(int request_id, uint64 position,
16 uint64 size) { 16 uint64 size) {
17 DCHECK(next_handler_); 17 DCHECK(next_handler_);
18 return next_handler_->OnUploadProgress(request_id, position, size); 18 return next_handler_->OnUploadProgress(request_id, position, size);
19 } 19 }
20 20
21 bool LayeredResourceHandler::OnRequestRedirected(int request_id, 21 bool LayeredResourceHandler::OnRequestRedirected(int request_id,
22 const GURL& url, 22 const GURL& url,
23 ResourceResponse* response, 23 ResourceResponse* response,
24 bool* defer) { 24 bool* defer) {
25 DCHECK(next_handler_); 25 DCHECK(next_handler_);
26 return next_handler_->OnRequestRedirected(request_id, url, response, defer); 26 return next_handler_->OnRequestRedirected(request_id, url, response, defer);
27 } 27 }
28 28
29 bool LayeredResourceHandler::OnResponseStarted(int request_id, 29 bool LayeredResourceHandler::OnResponseStarted(int request_id,
30 ResourceResponse* response) { 30 ResourceResponse* response,
31 bool* defer) {
31 DCHECK(next_handler_); 32 DCHECK(next_handler_);
32 return next_handler_->OnResponseStarted(request_id, response); 33 return next_handler_->OnResponseStarted(request_id, response, defer);
33 } 34 }
34 35
35 bool LayeredResourceHandler::OnWillStart(int request_id, const GURL& url, 36 bool LayeredResourceHandler::OnWillStart(int request_id, const GURL& url,
36 bool* defer) { 37 bool* defer) {
37 DCHECK(next_handler_); 38 DCHECK(next_handler_);
38 return next_handler_->OnWillStart(request_id, url, defer); 39 return next_handler_->OnWillStart(request_id, url, defer);
39 } 40 }
40 41
41 bool LayeredResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, 42 bool LayeredResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf,
42 int* buf_size, int min_size) { 43 int* buf_size, int min_size) {
43 DCHECK(next_handler_); 44 DCHECK(next_handler_);
44 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size); 45 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size);
45 } 46 }
46 47
47 bool LayeredResourceHandler::OnReadCompleted(int request_id, int* bytes_read) { 48 bool LayeredResourceHandler::OnReadCompleted(int request_id, int* bytes_read,
49 bool* defer) {
48 DCHECK(next_handler_); 50 DCHECK(next_handler_);
49 return next_handler_->OnReadCompleted(request_id, bytes_read); 51 return next_handler_->OnReadCompleted(request_id, bytes_read, defer);
50 } 52 }
51 53
52 bool LayeredResourceHandler::OnResponseCompleted( 54 bool LayeredResourceHandler::OnResponseCompleted(
53 int request_id, 55 int request_id,
54 const net::URLRequestStatus& status, 56 const net::URLRequestStatus& status,
55 const std::string& security_info) { 57 const std::string& security_info) {
56 DCHECK(next_handler_); 58 DCHECK(next_handler_);
57 return next_handler_->OnResponseCompleted(request_id, status, security_info); 59 return next_handler_->OnResponseCompleted(request_id, status, security_info);
58 } 60 }
59 61
60 void LayeredResourceHandler::OnRequestClosed() { 62 void LayeredResourceHandler::OnRequestClosed() {
61 DCHECK(next_handler_); 63 DCHECK(next_handler_);
62 next_handler_->OnRequestClosed(); 64 next_handler_->OnRequestClosed();
63 } 65 }
64 66
65 void LayeredResourceHandler::OnDataDownloaded(int request_id, 67 void LayeredResourceHandler::OnDataDownloaded(int request_id,
66 int bytes_downloaded) { 68 int bytes_downloaded) {
67 DCHECK(next_handler_); 69 DCHECK(next_handler_);
68 next_handler_->OnDataDownloaded(request_id, bytes_downloaded); 70 next_handler_->OnDataDownloaded(request_id, bytes_downloaded);
69 } 71 }
70 72
71 LayeredResourceHandler::~LayeredResourceHandler() { 73 LayeredResourceHandler::~LayeredResourceHandler() {
72 } 74 }
73 75
74 } // namespace content 76 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698