| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/detachable_resource_handler.h" | 5 #include "content/browser/loader/detachable_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/loader/resource_request_info_impl.h" | 9 #include "content/browser/loader/resource_request_info_impl.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 void DetachableResourceHandler::SetController(ResourceController* controller) { | 81 void DetachableResourceHandler::SetController(ResourceController* controller) { |
| 82 ResourceHandler::SetController(controller); | 82 ResourceHandler::SetController(controller); |
| 83 | 83 |
| 84 // Intercept the ResourceController for downstream handlers to keep track of | 84 // Intercept the ResourceController for downstream handlers to keep track of |
| 85 // whether the request is deferred. | 85 // whether the request is deferred. |
| 86 if (next_handler_) | 86 if (next_handler_) |
| 87 next_handler_->SetController(this); | 87 next_handler_->SetController(this); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool DetachableResourceHandler::OnUploadProgress(uint64 position, uint64 size) { | |
| 91 if (!next_handler_) | |
| 92 return true; | |
| 93 | |
| 94 return next_handler_->OnUploadProgress(position, size); | |
| 95 } | |
| 96 | |
| 97 bool DetachableResourceHandler::OnRequestRedirected( | 90 bool DetachableResourceHandler::OnRequestRedirected( |
| 98 const net::RedirectInfo& redirect_info, | 91 const net::RedirectInfo& redirect_info, |
| 99 ResourceResponse* response, | 92 ResourceResponse* response, |
| 100 bool* defer) { | 93 bool* defer) { |
| 101 DCHECK(!is_deferred_); | 94 DCHECK(!is_deferred_); |
| 102 | 95 |
| 103 if (!next_handler_) | 96 if (!next_handler_) |
| 104 return true; | 97 return true; |
| 105 | 98 |
| 106 bool ret = next_handler_->OnRequestRedirected( | 99 bool ret = next_handler_->OnRequestRedirected( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 201 |
| 209 void DetachableResourceHandler::CancelAndIgnore() { | 202 void DetachableResourceHandler::CancelAndIgnore() { |
| 210 controller()->CancelAndIgnore(); | 203 controller()->CancelAndIgnore(); |
| 211 } | 204 } |
| 212 | 205 |
| 213 void DetachableResourceHandler::CancelWithError(int error_code) { | 206 void DetachableResourceHandler::CancelWithError(int error_code) { |
| 214 controller()->CancelWithError(error_code); | 207 controller()->CancelWithError(error_code); |
| 215 } | 208 } |
| 216 | 209 |
| 217 } // namespace content | 210 } // namespace content |
| OLD | NEW |