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

Side by Side Diff: trunk/src/content/browser/loader/layered_resource_handler.cc

Issue 26472004: Revert 227318 "Clean up ResourceHandler API." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 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/loader/layered_resource_handler.h" 5 #include "content/browser/loader/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( 11 LayeredResourceHandler::LayeredResourceHandler(
12 net::URLRequest* request,
13 scoped_ptr<ResourceHandler> next_handler) 12 scoped_ptr<ResourceHandler> next_handler)
14 : ResourceHandler(request), 13 : next_handler_(next_handler.Pass()) {
15 next_handler_(next_handler.Pass()) {
16 } 14 }
17 15
18 LayeredResourceHandler::~LayeredResourceHandler() { 16 LayeredResourceHandler::~LayeredResourceHandler() {
19 } 17 }
20 18
21 void LayeredResourceHandler::SetController(ResourceController* controller) { 19 void LayeredResourceHandler::SetController(ResourceController* controller) {
22 ResourceHandler::SetController(controller); 20 ResourceHandler::SetController(controller);
23 21
24 // Pass the controller down to the next handler. This method is intended to 22 // Pass the controller down to the next handler. This method is intended to
25 // be overriden by subclasses of LayeredResourceHandler that need to insert a 23 // be overriden by subclasses of LayeredResourceHandler that need to insert a
(...skipping 23 matching lines...) Expand all
49 DCHECK(next_handler_.get()); 47 DCHECK(next_handler_.get());
50 return next_handler_->OnResponseStarted(request_id, response, defer); 48 return next_handler_->OnResponseStarted(request_id, response, defer);
51 } 49 }
52 50
53 bool LayeredResourceHandler::OnWillStart(int request_id, const GURL& url, 51 bool LayeredResourceHandler::OnWillStart(int request_id, const GURL& url,
54 bool* defer) { 52 bool* defer) {
55 DCHECK(next_handler_.get()); 53 DCHECK(next_handler_.get());
56 return next_handler_->OnWillStart(request_id, url, defer); 54 return next_handler_->OnWillStart(request_id, url, defer);
57 } 55 }
58 56
59 bool LayeredResourceHandler::OnWillRead(int request_id, 57 bool LayeredResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf,
60 scoped_refptr<net::IOBuffer>* buf, 58 int* buf_size, int min_size) {
61 int* buf_size,
62 int min_size) {
63 DCHECK(next_handler_.get()); 59 DCHECK(next_handler_.get());
64 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size); 60 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size);
65 } 61 }
66 62
67 bool LayeredResourceHandler::OnReadCompleted(int request_id, int bytes_read, 63 bool LayeredResourceHandler::OnReadCompleted(int request_id, int bytes_read,
68 bool* defer) { 64 bool* defer) {
69 DCHECK(next_handler_.get()); 65 DCHECK(next_handler_.get());
70 return next_handler_->OnReadCompleted(request_id, bytes_read, defer); 66 return next_handler_->OnReadCompleted(request_id, bytes_read, defer);
71 } 67 }
72 68
73 bool LayeredResourceHandler::OnResponseCompleted( 69 bool LayeredResourceHandler::OnResponseCompleted(
74 int request_id, 70 int request_id,
75 const net::URLRequestStatus& status, 71 const net::URLRequestStatus& status,
76 const std::string& security_info) { 72 const std::string& security_info) {
77 DCHECK(next_handler_.get()); 73 DCHECK(next_handler_.get());
78 return next_handler_->OnResponseCompleted(request_id, status, security_info); 74 return next_handler_->OnResponseCompleted(request_id, status, security_info);
79 } 75 }
80 76
81 void LayeredResourceHandler::OnDataDownloaded(int request_id, 77 void LayeredResourceHandler::OnDataDownloaded(int request_id,
82 int bytes_downloaded) { 78 int bytes_downloaded) {
83 DCHECK(next_handler_.get()); 79 DCHECK(next_handler_.get());
84 next_handler_->OnDataDownloaded(request_id, bytes_downloaded); 80 next_handler_->OnDataDownloaded(request_id, bytes_downloaded);
85 } 81 }
86 82
87 } // namespace content 83 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698