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

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

Issue 2476163003: Refactor ResourceHandler API. (Closed)
Patch Set: Minor cleanups, one real fix Created 4 years, 1 month 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/loader/layered_resource_handler.h" 5 #include "content/browser/loader/layered_resource_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 11 matching lines...) Expand all
22 ResourceHandler::SetController(controller); 22 ResourceHandler::SetController(controller);
23 23
24 // 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
25 // be overriden by subclasses of LayeredResourceHandler that need to insert a 25 // be overriden by subclasses of LayeredResourceHandler that need to insert a
26 // different ResourceController. 26 // different ResourceController.
27 27
28 DCHECK(next_handler_.get()); 28 DCHECK(next_handler_.get());
29 next_handler_->SetController(controller); 29 next_handler_->SetController(controller);
30 } 30 }
31 31
32 bool LayeredResourceHandler::OnRequestRedirected( 32 void LayeredResourceHandler::OnRequestRedirected(
33 const net::RedirectInfo& redirect_info, 33 const net::RedirectInfo& redirect_info,
34 ResourceResponse* response, 34 ResourceResponse* response,
35 bool* defer) { 35 bool* defer_or_cancel) {
36 DCHECK(next_handler_.get()); 36 DCHECK(next_handler_.get());
37 return next_handler_->OnRequestRedirected(redirect_info, response, defer); 37 next_handler_->OnRequestRedirected(redirect_info, response, defer_or_cancel);
38 } 38 }
39 39
40 bool LayeredResourceHandler::OnResponseStarted(ResourceResponse* response, 40 void LayeredResourceHandler::OnResponseStarted(ResourceResponse* response,
41 bool* defer) { 41 bool* defer_or_cancel) {
42 DCHECK(next_handler_.get()); 42 DCHECK(next_handler_.get());
43 return next_handler_->OnResponseStarted(response, defer); 43 next_handler_->OnResponseStarted(response, defer_or_cancel);
44 } 44 }
45 45
46 bool LayeredResourceHandler::OnWillStart(const GURL& url, 46 void LayeredResourceHandler::OnWillStart(const GURL& url,
47 bool* defer) { 47 bool* defer_or_cancel) {
48 DCHECK(next_handler_.get()); 48 DCHECK(next_handler_.get());
49 return next_handler_->OnWillStart(url, defer); 49 next_handler_->OnWillStart(url, defer_or_cancel);
50 } 50 }
51 51
52 bool LayeredResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, 52 bool LayeredResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf,
53 int* buf_size, 53 int* buf_size,
54 int min_size) { 54 int min_size) {
55 DCHECK(next_handler_.get()); 55 DCHECK(next_handler_.get());
56 return next_handler_->OnWillRead(buf, buf_size, min_size); 56 return next_handler_->OnWillRead(buf, buf_size, min_size);
57 } 57 }
58 58
59 bool LayeredResourceHandler::OnReadCompleted(int bytes_read, bool* defer) { 59 void LayeredResourceHandler::OnReadCompleted(int bytes_read,
60 bool* defer_or_cancel) {
60 DCHECK(next_handler_.get()); 61 DCHECK(next_handler_.get());
61 return next_handler_->OnReadCompleted(bytes_read, defer); 62 next_handler_->OnReadCompleted(bytes_read, defer_or_cancel);
62 } 63 }
63 64
64 void LayeredResourceHandler::OnResponseCompleted( 65 void LayeredResourceHandler::OnResponseCompleted(
65 const net::URLRequestStatus& status, 66 const net::URLRequestStatus& status,
66 bool* defer) { 67 bool* defer) {
67 DCHECK(next_handler_.get()); 68 DCHECK(next_handler_.get());
68 next_handler_->OnResponseCompleted(status, defer); 69 next_handler_->OnResponseCompleted(status, defer);
69 } 70 }
70 71
71 void LayeredResourceHandler::OnDataDownloaded(int bytes_downloaded) { 72 void LayeredResourceHandler::OnDataDownloaded(int bytes_downloaded) {
72 DCHECK(next_handler_.get()); 73 DCHECK(next_handler_.get());
73 next_handler_->OnDataDownloaded(bytes_downloaded); 74 next_handler_->OnDataDownloaded(bytes_downloaded);
74 } 75 }
75 76
76 } // namespace content 77 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/layered_resource_handler.h ('k') | content/browser/loader/mime_sniffing_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698