| 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> | 7 #include <utility> |
| 8 | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 LayeredResourceHandler::LayeredResourceHandler( | 13 LayeredResourceHandler::LayeredResourceHandler( |
| 14 net::URLRequest* request, | 14 net::URLRequest* request, |
| 15 scoped_ptr<ResourceHandler> next_handler) | 15 scoped_ptr<ResourceHandler> next_handler) |
| 16 : ResourceHandler(request), next_handler_(std::move(next_handler)) {} | 16 : ResourceHandler(request), next_handler_(std::move(next_handler)) {} |
| 17 | 17 |
| 18 LayeredResourceHandler::~LayeredResourceHandler() { | 18 LayeredResourceHandler::~LayeredResourceHandler() { |
| 19 TRACE_EVENT0("toplevel", "LayeredResourceHandler::~LayeredResourceHandler"); |
| 19 } | 20 } |
| 20 | 21 |
| 21 void LayeredResourceHandler::SetController(ResourceController* controller) { | 22 void LayeredResourceHandler::SetController(ResourceController* controller) { |
| 22 ResourceHandler::SetController(controller); | 23 ResourceHandler::SetController(controller); |
| 23 | 24 |
| 24 // Pass the controller down to the next handler. This method is intended to | 25 // 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 | 26 // be overriden by subclasses of LayeredResourceHandler that need to insert a |
| 26 // different ResourceController. | 27 // different ResourceController. |
| 27 | 28 |
| 28 DCHECK(next_handler_.get()); | 29 DCHECK(next_handler_.get()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 DCHECK(next_handler_.get()); | 75 DCHECK(next_handler_.get()); |
| 75 next_handler_->OnResponseCompleted(status, security_info, defer); | 76 next_handler_->OnResponseCompleted(status, security_info, defer); |
| 76 } | 77 } |
| 77 | 78 |
| 78 void LayeredResourceHandler::OnDataDownloaded(int bytes_downloaded) { | 79 void LayeredResourceHandler::OnDataDownloaded(int bytes_downloaded) { |
| 79 DCHECK(next_handler_.get()); | 80 DCHECK(next_handler_.get()); |
| 80 next_handler_->OnDataDownloaded(bytes_downloaded); | 81 next_handler_->OnDataDownloaded(bytes_downloaded); |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace content | 84 } // namespace content |
| OLD | NEW |