OLD | NEW |
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> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 | 10 |
9 namespace content { | 11 namespace content { |
10 | 12 |
11 LayeredResourceHandler::LayeredResourceHandler( | 13 LayeredResourceHandler::LayeredResourceHandler( |
12 net::URLRequest* request, | 14 net::URLRequest* request, |
13 scoped_ptr<ResourceHandler> next_handler) | 15 scoped_ptr<ResourceHandler> next_handler) |
14 : ResourceHandler(request), | 16 : ResourceHandler(request), next_handler_(std::move(next_handler)) {} |
15 next_handler_(next_handler.Pass()) { | |
16 } | |
17 | 17 |
18 LayeredResourceHandler::~LayeredResourceHandler() { | 18 LayeredResourceHandler::~LayeredResourceHandler() { |
19 } | 19 } |
20 | 20 |
21 void LayeredResourceHandler::SetController(ResourceController* controller) { | 21 void LayeredResourceHandler::SetController(ResourceController* controller) { |
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. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DCHECK(next_handler_.get()); | 74 DCHECK(next_handler_.get()); |
75 next_handler_->OnResponseCompleted(status, security_info, defer); | 75 next_handler_->OnResponseCompleted(status, security_info, defer); |
76 } | 76 } |
77 | 77 |
78 void LayeredResourceHandler::OnDataDownloaded(int bytes_downloaded) { | 78 void LayeredResourceHandler::OnDataDownloaded(int bytes_downloaded) { |
79 DCHECK(next_handler_.get()); | 79 DCHECK(next_handler_.get()); |
80 next_handler_->OnDataDownloaded(bytes_downloaded); | 80 next_handler_->OnDataDownloaded(bytes_downloaded); |
81 } | 81 } |
82 | 82 |
83 } // namespace content | 83 } // namespace content |
OLD | NEW |