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

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

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

Powered by Google App Engine
This is Rietveld 408576698