| 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 "webkit/media/webmediaplayer_impl.h" | 5 #include "webkit/media/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 DCHECK_EQ(main_loop_, MessageLoop::current()); | 311 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 312 return true; | 312 return true; |
| 313 } | 313 } |
| 314 | 314 |
| 315 void WebMediaPlayerImpl::seek(float seconds) { | 315 void WebMediaPlayerImpl::seek(float seconds) { |
| 316 DCHECK_EQ(main_loop_, MessageLoop::current()); | 316 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 317 | 317 |
| 318 if (seeking_) { | 318 if (seeking_) { |
| 319 pending_seek_ = true; | 319 pending_seek_ = true; |
| 320 pending_seek_seconds_ = seconds; | 320 pending_seek_seconds_ = seconds; |
| 321 proxy_->DemuxerCancelPendingSeek(); |
| 321 return; | 322 return; |
| 322 } | 323 } |
| 323 | 324 |
| 324 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); | 325 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); |
| 325 | 326 |
| 326 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); | 327 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); |
| 327 | 328 |
| 328 // Update our paused time. | 329 // Update our paused time. |
| 329 if (paused_) | 330 if (paused_) |
| 330 paused_time_ = seek_time; | 331 paused_time_ = seek_time; |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 return audio_source_provider_; | 1031 return audio_source_provider_; |
| 1031 } | 1032 } |
| 1032 | 1033 |
| 1033 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1034 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 1034 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1035 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1035 incremented_externally_allocated_memory_ = true; | 1036 incremented_externally_allocated_memory_ = true; |
| 1036 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1037 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 1037 } | 1038 } |
| 1038 | 1039 |
| 1039 } // namespace webkit_media | 1040 } // namespace webkit_media |
| OLD | NEW |