| 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/renderer_host/throttling_resource_handler.h" | 5 #include "content/browser/renderer_host/throttling_resource_handler.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
| 8 #include "content/public/browser/resource_throttle.h" | 8 #include "content/public/browser/resource_throttle.h" |
| 9 #include "content/public/common/resource_response.h" | 9 #include "content/public/common/resource_response.h" |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 void ThrottlingResourceHandler::OnRequestClosed() { | 96 void ThrottlingResourceHandler::OnRequestClosed() { |
| 97 throttles_.reset(); | 97 throttles_.reset(); |
| 98 next_handler_->OnRequestClosed(); | 98 next_handler_->OnRequestClosed(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void ThrottlingResourceHandler::Cancel() { | 101 void ThrottlingResourceHandler::Cancel() { |
| 102 host_->CancelRequest(child_id_, request_id_, false); | 102 host_->CancelRequest(child_id_, request_id_, false); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ThrottlingResourceHandler::CancelWithHandledExternallyStatus() { |
| 106 host_->CancelRequestWithHandledExternallyStatus(child_id_, request_id_); |
| 107 } |
| 108 |
| 105 void ThrottlingResourceHandler::Resume() { | 109 void ThrottlingResourceHandler::Resume() { |
| 106 switch (deferred_stage_) { | 110 switch (deferred_stage_) { |
| 107 case DEFERRED_NONE: | 111 case DEFERRED_NONE: |
| 108 NOTREACHED(); | 112 NOTREACHED(); |
| 109 break; | 113 break; |
| 110 case DEFERRED_START: | 114 case DEFERRED_START: |
| 111 ResumeStart(); | 115 ResumeStart(); |
| 112 break; | 116 break; |
| 113 case DEFERRED_REDIRECT: | 117 case DEFERRED_REDIRECT: |
| 114 ResumeRedirect(); | 118 ResumeRedirect(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 159 |
| 156 bool defer = false; | 160 bool defer = false; |
| 157 if (!OnResponseStarted(request_id_, response, &defer)) { | 161 if (!OnResponseStarted(request_id_, response, &defer)) { |
| 158 Cancel(); | 162 Cancel(); |
| 159 } else if (!defer) { | 163 } else if (!defer) { |
| 160 host_->ResumeDeferredRequest(child_id_, request_id_); | 164 host_->ResumeDeferredRequest(child_id_, request_id_); |
| 161 } | 165 } |
| 162 } | 166 } |
| 163 | 167 |
| 164 } // namespace content | 168 } // namespace content |
| OLD | NEW |