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/buffered_resource_handler.h" | 5 #include "content/browser/loader/buffered_resource_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 return next_handler_->OnResponseCompleted(request_id, status, security_info); | 194 return next_handler_->OnResponseCompleted(request_id, status, security_info); |
195 } | 195 } |
196 | 196 |
197 void BufferedResourceHandler::Resume() { | 197 void BufferedResourceHandler::Resume() { |
198 switch (state_) { | 198 switch (state_) { |
199 case STATE_BUFFERING: | 199 case STATE_BUFFERING: |
200 case STATE_PROCESSING: | 200 case STATE_PROCESSING: |
201 NOTREACHED(); | 201 NOTREACHED(); |
202 break; | 202 break; |
203 case STATE_REPLAYING: | 203 case STATE_REPLAYING: |
204 MessageLoop::current()->PostTask( | 204 base::MessageLoop::current()->PostTask( |
205 FROM_HERE, | 205 FROM_HERE, |
206 base::Bind(&BufferedResourceHandler::CallReplayReadCompleted, | 206 base::Bind(&BufferedResourceHandler::CallReplayReadCompleted, |
207 weak_ptr_factory_.GetWeakPtr())); | 207 weak_ptr_factory_.GetWeakPtr())); |
208 break; | 208 break; |
209 case STATE_STARTING: | 209 case STATE_STARTING: |
210 case STATE_STREAMING: | 210 case STATE_STREAMING: |
211 controller()->Resume(); | 211 controller()->Resume(); |
212 break; | 212 break; |
213 } | 213 } |
214 } | 214 } |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 const std::vector<webkit::WebPluginInfo>& plugins) { | 463 const std::vector<webkit::WebPluginInfo>& plugins) { |
464 bool defer = false; | 464 bool defer = false; |
465 if (!ProcessResponse(&defer)) { | 465 if (!ProcessResponse(&defer)) { |
466 controller()->Cancel(); | 466 controller()->Cancel(); |
467 } else if (!defer) { | 467 } else if (!defer) { |
468 controller()->Resume(); | 468 controller()->Resume(); |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 } // namespace content | 472 } // namespace content |
OLD | NEW |