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

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

Issue 10501004: Refactor the guts of ResourceDispatcherHostImpl into a new class named (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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( 11 LayeredResourceHandler::LayeredResourceHandler(
12 scoped_ptr<ResourceHandler> next_handler) 12 scoped_ptr<ResourceHandler> next_handler)
13 : next_handler_(next_handler.Pass()) { 13 : next_handler_(next_handler.Pass()) {
14 } 14 }
15 15
16 LayeredResourceHandler::~LayeredResourceHandler() { 16 LayeredResourceHandler::~LayeredResourceHandler() {
17 } 17 }
18 18
19 void LayeredResourceHandler::SetController(ResourceController* controller) {
20 ResourceHandler::SetController(controller);
21
22 // 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
24 // different ResourceController.
25
26 DCHECK(next_handler_.get());
27 next_handler_->SetController(controller);
28 }
29
19 bool LayeredResourceHandler::OnUploadProgress(int request_id, uint64 position, 30 bool LayeredResourceHandler::OnUploadProgress(int request_id, uint64 position,
20 uint64 size) { 31 uint64 size) {
21 DCHECK(next_handler_.get()); 32 DCHECK(next_handler_.get());
22 return next_handler_->OnUploadProgress(request_id, position, size); 33 return next_handler_->OnUploadProgress(request_id, position, size);
23 } 34 }
24 35
25 bool LayeredResourceHandler::OnRequestRedirected(int request_id, 36 bool LayeredResourceHandler::OnRequestRedirected(int request_id,
26 const GURL& url, 37 const GURL& url,
27 ResourceResponse* response, 38 ResourceResponse* response,
28 bool* defer) { 39 bool* defer) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return next_handler_->OnResponseCompleted(request_id, status, security_info); 74 return next_handler_->OnResponseCompleted(request_id, status, security_info);
64 } 75 }
65 76
66 void LayeredResourceHandler::OnDataDownloaded(int request_id, 77 void LayeredResourceHandler::OnDataDownloaded(int request_id,
67 int bytes_downloaded) { 78 int bytes_downloaded) {
68 DCHECK(next_handler_.get()); 79 DCHECK(next_handler_.get());
69 next_handler_->OnDataDownloaded(request_id, bytes_downloaded); 80 next_handler_->OnDataDownloaded(request_id, bytes_downloaded);
70 } 81 }
71 82
72 } // namespace content 83 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698