| 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/renderer/media/webmediaplayer_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 DCHECK(main_loop_->BelongsToCurrentThread()); | 1197 DCHECK(main_loop_->BelongsToCurrentThread()); |
| 1198 | 1198 |
| 1199 // Abort any pending IO so stopping the pipeline doesn't get blocked. | 1199 // Abort any pending IO so stopping the pipeline doesn't get blocked. |
| 1200 if (data_source_) | 1200 if (data_source_) |
| 1201 data_source_->Abort(); | 1201 data_source_->Abort(); |
| 1202 if (chunk_demuxer_) { | 1202 if (chunk_demuxer_) { |
| 1203 chunk_demuxer_->Shutdown(); | 1203 chunk_demuxer_->Shutdown(); |
| 1204 chunk_demuxer_ = NULL; | 1204 chunk_demuxer_ = NULL; |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 gpu_factories_ = NULL; | 1207 if (gpu_factories_.get()) { |
| 1208 gpu_factories_->Abort(); |
| 1209 gpu_factories_ = NULL; |
| 1210 } |
| 1208 | 1211 |
| 1209 // Make sure to kill the pipeline so there's no more media threads running. | 1212 // Make sure to kill the pipeline so there's no more media threads running. |
| 1210 // Note: stopping the pipeline might block for a long time. | 1213 // Note: stopping the pipeline might block for a long time. |
| 1211 base::WaitableEvent waiter(false, false); | 1214 base::WaitableEvent waiter(false, false); |
| 1212 pipeline_->Stop(base::Bind( | 1215 pipeline_->Stop(base::Bind( |
| 1213 &base::WaitableEvent::Signal, base::Unretained(&waiter))); | 1216 &base::WaitableEvent::Signal, base::Unretained(&waiter))); |
| 1214 waiter.Wait(); | 1217 waiter.Wait(); |
| 1215 | 1218 |
| 1216 // Let V8 know we are not using extra resources anymore. | 1219 // Let V8 know we are not using extra resources anymore. |
| 1217 if (incremented_externally_allocated_memory_) { | 1220 if (incremented_externally_allocated_memory_) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 | 1306 |
| 1304 if (web_cdm_) { | 1307 if (web_cdm_) { |
| 1305 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); | 1308 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); |
| 1306 return; | 1309 return; |
| 1307 } | 1310 } |
| 1308 | 1311 |
| 1309 decryptor_ready_cb_ = decryptor_ready_cb; | 1312 decryptor_ready_cb_ = decryptor_ready_cb; |
| 1310 } | 1313 } |
| 1311 | 1314 |
| 1312 } // namespace content | 1315 } // namespace content |
| OLD | NEW |