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 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 DCHECK(main_loop_->BelongsToCurrentThread()); | 1178 DCHECK(main_loop_->BelongsToCurrentThread()); |
1179 | 1179 |
1180 // Abort any pending IO so stopping the pipeline doesn't get blocked. | 1180 // Abort any pending IO so stopping the pipeline doesn't get blocked. |
1181 if (data_source_) | 1181 if (data_source_) |
1182 data_source_->Abort(); | 1182 data_source_->Abort(); |
1183 if (chunk_demuxer_) { | 1183 if (chunk_demuxer_) { |
1184 chunk_demuxer_->Shutdown(); | 1184 chunk_demuxer_->Shutdown(); |
1185 chunk_demuxer_ = NULL; | 1185 chunk_demuxer_ = NULL; |
1186 } | 1186 } |
1187 | 1187 |
1188 if (gpu_factories_.get()) { | 1188 gpu_factories_ = NULL; |
1189 gpu_factories_->Abort(); | |
1190 gpu_factories_ = NULL; | |
1191 } | |
1192 | 1189 |
1193 // Make sure to kill the pipeline so there's no more media threads running. | 1190 // Make sure to kill the pipeline so there's no more media threads running. |
1194 // Note: stopping the pipeline might block for a long time. | 1191 // Note: stopping the pipeline might block for a long time. |
1195 base::WaitableEvent waiter(false, false); | 1192 base::WaitableEvent waiter(false, false); |
1196 pipeline_->Stop(base::Bind( | 1193 pipeline_->Stop(base::Bind( |
1197 &base::WaitableEvent::Signal, base::Unretained(&waiter))); | 1194 &base::WaitableEvent::Signal, base::Unretained(&waiter))); |
1198 waiter.Wait(); | 1195 waiter.Wait(); |
1199 | 1196 |
1200 // Let V8 know we are not using extra resources anymore. | 1197 // Let V8 know we are not using extra resources anymore. |
1201 if (incremented_externally_allocated_memory_) { | 1198 if (incremented_externally_allocated_memory_) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 | 1264 |
1268 if (pending_repaint_) | 1265 if (pending_repaint_) |
1269 return; | 1266 return; |
1270 | 1267 |
1271 pending_repaint_ = true; | 1268 pending_repaint_ = true; |
1272 main_loop_->PostTask(FROM_HERE, base::Bind( | 1269 main_loop_->PostTask(FROM_HERE, base::Bind( |
1273 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); | 1270 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); |
1274 } | 1271 } |
1275 | 1272 |
1276 } // namespace content | 1273 } // namespace content |
OLD | NEW |