| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #include "media/audio/null_audio_sink.h" | 18 #include "media/audio/null_audio_sink.h" |
| 19 #include "media/base/bind_to_loop.h" | 19 #include "media/base/bind_to_loop.h" |
| 20 #include "media/base/filter_collection.h" | 20 #include "media/base/filter_collection.h" |
| 21 #include "media/base/limits.h" | 21 #include "media/base/limits.h" |
| 22 #include "media/base/media_log.h" | 22 #include "media/base/media_log.h" |
| 23 #include "media/base/media_switches.h" | 23 #include "media/base/media_switches.h" |
| 24 #include "media/base/pipeline.h" | 24 #include "media/base/pipeline.h" |
| 25 #include "media/base/video_frame.h" | 25 #include "media/base/video_frame.h" |
| 26 #include "media/filters/audio_renderer_impl.h" | 26 #include "media/filters/audio_renderer_impl.h" |
| 27 #include "media/filters/chunk_demuxer.h" |
| 27 #include "media/filters/video_renderer_base.h" | 28 #include "media/filters/video_renderer_base.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 34 #include "v8/include/v8.h" | 35 #include "v8/include/v8.h" |
| 35 #include "webkit/media/buffered_data_source.h" | 36 #include "webkit/media/buffered_data_source.h" |
| 36 #include "webkit/media/filter_helpers.h" | 37 #include "webkit/media/filter_helpers.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 static WebKit::WebTimeRanges ConvertToWebTimeRanges( | 99 static WebKit::WebTimeRanges ConvertToWebTimeRanges( |
| 99 const media::Ranges<base::TimeDelta>& ranges) { | 100 const media::Ranges<base::TimeDelta>& ranges) { |
| 100 WebKit::WebTimeRanges result(ranges.size()); | 101 WebKit::WebTimeRanges result(ranges.size()); |
| 101 for (size_t i = 0; i < ranges.size(); i++) { | 102 for (size_t i = 0; i < ranges.size(); i++) { |
| 102 result[i].start = ranges.start(i).InSecondsF(); | 103 result[i].start = ranges.start(i).InSecondsF(); |
| 103 result[i].end = ranges.end(i).InSecondsF(); | 104 result[i].end = ranges.end(i).InSecondsF(); |
| 104 } | 105 } |
| 105 return result; | 106 return result; |
| 106 } | 107 } |
| 107 | 108 |
| 109 // TODO(acolwell): Investigate whether the key_system & session_id parameters |
| 110 // are really necessary. |
| 111 typedef base::Callback<void(const std::string&, |
| 112 const std::string&, |
| 113 scoped_array<uint8>, |
| 114 int)> OnNeedKeyCB; |
| 115 |
| 116 static void OnDemuxerNeedKeyTrampoline( |
| 117 const scoped_refptr<base::MessageLoopProxy>& message_loop, |
| 118 const OnNeedKeyCB& need_key_cb, |
| 119 scoped_array<uint8> init_data, |
| 120 int init_data_size) { |
| 121 message_loop->PostTask(FROM_HERE, base::Bind( |
| 122 need_key_cb, "", "", base::Passed(&init_data), init_data_size)); |
| 123 } |
| 124 |
| 108 WebMediaPlayerImpl::WebMediaPlayerImpl( | 125 WebMediaPlayerImpl::WebMediaPlayerImpl( |
| 109 WebKit::WebFrame* frame, | 126 WebKit::WebFrame* frame, |
| 110 WebKit::WebMediaPlayerClient* client, | 127 WebKit::WebMediaPlayerClient* client, |
| 111 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 128 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
| 112 media::FilterCollection* collection, | 129 media::FilterCollection* collection, |
| 113 WebKit::WebAudioSourceProvider* audio_source_provider, | 130 WebKit::WebAudioSourceProvider* audio_source_provider, |
| 114 media::AudioRendererSink* audio_renderer_sink, | 131 media::AudioRendererSink* audio_renderer_sink, |
| 115 media::MessageLoopFactory* message_loop_factory, | 132 media::MessageLoopFactory* message_loop_factory, |
| 116 MediaStreamClient* media_stream_client, | 133 MediaStreamClient* media_stream_client, |
| 117 media::MediaLog* media_log) | 134 media::MediaLog* media_log) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // Media streams pipelines can start immediately. | 259 // Media streams pipelines can start immediately. |
| 243 if (BuildMediaStreamCollection(url, media_stream_client_, | 260 if (BuildMediaStreamCollection(url, media_stream_client_, |
| 244 message_loop_factory_.get(), | 261 message_loop_factory_.get(), |
| 245 filter_collection_.get())) { | 262 filter_collection_.get())) { |
| 246 supports_save_ = false; | 263 supports_save_ = false; |
| 247 StartPipeline(); | 264 StartPipeline(); |
| 248 return; | 265 return; |
| 249 } | 266 } |
| 250 | 267 |
| 251 // Media source pipelines can start immediately. | 268 // Media source pipelines can start immediately. |
| 252 if (BuildMediaSourceCollection(url, GetClient()->sourceURL(), proxy_, | 269 if (!url.isEmpty() && url == GetClient()->sourceURL()) { |
| 253 message_loop_factory_.get(), | 270 chunk_demuxer_ = new media::ChunkDemuxer( |
| 254 filter_collection_.get(), | 271 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), |
| 255 &decryptor_)) { | 272 base::Bind(&OnDemuxerNeedKeyTrampoline, |
| 273 main_loop_->message_loop_proxy(), |
| 274 base::Bind(&WebMediaPlayerImpl::OnNeedKey, AsWeakPtr()))); |
| 275 |
| 276 BuildMediaSourceCollection(chunk_demuxer_, |
| 277 message_loop_factory_.get(), |
| 278 filter_collection_.get(), |
| 279 &decryptor_); |
| 256 supports_save_ = false; | 280 supports_save_ = false; |
| 257 StartPipeline(); | 281 StartPipeline(); |
| 258 return; | 282 return; |
| 259 } | 283 } |
| 260 | 284 |
| 261 // Otherwise it's a regular request which requires resolving the URL first. | 285 // Otherwise it's a regular request which requires resolving the URL first. |
| 262 proxy_->set_data_source( | 286 proxy_->set_data_source( |
| 263 new BufferedDataSource(main_loop_, frame_, media_log_, | 287 new BufferedDataSource(main_loop_, frame_, media_log_, |
| 264 base::Bind(&WebMediaPlayerImpl::NotifyDownloading, | 288 base::Bind(&WebMediaPlayerImpl::NotifyDownloading, |
| 265 AsWeakPtr()))); | 289 AsWeakPtr()))); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 DCHECK_EQ(main_loop_, MessageLoop::current()); | 339 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 316 return supports_save_; | 340 return supports_save_; |
| 317 } | 341 } |
| 318 | 342 |
| 319 void WebMediaPlayerImpl::seek(float seconds) { | 343 void WebMediaPlayerImpl::seek(float seconds) { |
| 320 DCHECK_EQ(main_loop_, MessageLoop::current()); | 344 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 321 | 345 |
| 322 if (starting_ || seeking_) { | 346 if (starting_ || seeking_) { |
| 323 pending_seek_ = true; | 347 pending_seek_ = true; |
| 324 pending_seek_seconds_ = seconds; | 348 pending_seek_seconds_ = seconds; |
| 325 proxy_->DemuxerCancelPendingSeek(); | 349 if (chunk_demuxer_) |
| 350 chunk_demuxer_->CancelPendingSeek(); |
| 326 return; | 351 return; |
| 327 } | 352 } |
| 328 | 353 |
| 329 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); | 354 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); |
| 330 | 355 |
| 331 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); | 356 base::TimeDelta seek_time = ConvertSecondsToTimestamp(seconds); |
| 332 | 357 |
| 333 // Update our paused time. | 358 // Update our paused time. |
| 334 if (paused_) | 359 if (paused_) |
| 335 paused_time_ = seek_time; | 360 paused_time_ = seek_time; |
| 336 | 361 |
| 337 seeking_ = true; | 362 seeking_ = true; |
| 338 | 363 |
| 339 proxy_->DemuxerStartWaitingForSeek(); | 364 if (chunk_demuxer_) |
| 365 chunk_demuxer_->StartWaitingForSeek(); |
| 340 | 366 |
| 341 // Kick off the asynchronous seek! | 367 // Kick off the asynchronous seek! |
| 342 pipeline_->Seek( | 368 pipeline_->Seek( |
| 343 seek_time, | 369 seek_time, |
| 344 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek)); | 370 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnPipelineSeek)); |
| 345 } | 371 } |
| 346 | 372 |
| 347 void WebMediaPlayerImpl::setEndTime(float seconds) { | 373 void WebMediaPlayerImpl::setEndTime(float seconds) { |
| 348 DCHECK_EQ(main_loop_, MessageLoop::current()); | 374 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 349 | 375 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 WebKit::WebMediaPlayer::AddIdStatus WebMediaPlayerImpl::sourceAddId( | 649 WebKit::WebMediaPlayer::AddIdStatus WebMediaPlayerImpl::sourceAddId( |
| 624 const WebKit::WebString& id, | 650 const WebKit::WebString& id, |
| 625 const WebKit::WebString& type, | 651 const WebKit::WebString& type, |
| 626 const WebKit::WebVector<WebKit::WebString>& codecs) { | 652 const WebKit::WebVector<WebKit::WebString>& codecs) { |
| 627 DCHECK_EQ(main_loop_, MessageLoop::current()); | 653 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 628 std::vector<std::string> new_codecs(codecs.size()); | 654 std::vector<std::string> new_codecs(codecs.size()); |
| 629 for (size_t i = 0; i < codecs.size(); ++i) | 655 for (size_t i = 0; i < codecs.size(); ++i) |
| 630 new_codecs[i] = codecs[i].utf8().data(); | 656 new_codecs[i] = codecs[i].utf8().data(); |
| 631 | 657 |
| 632 return static_cast<WebKit::WebMediaPlayer::AddIdStatus>( | 658 return static_cast<WebKit::WebMediaPlayer::AddIdStatus>( |
| 633 proxy_->DemuxerAddId(id.utf8().data(), type.utf8().data(), | 659 chunk_demuxer_->AddId(id.utf8().data(), type.utf8().data(), new_codecs)); |
| 634 new_codecs)); | |
| 635 } | 660 } |
| 636 | 661 |
| 637 bool WebMediaPlayerImpl::sourceRemoveId(const WebKit::WebString& id) { | 662 bool WebMediaPlayerImpl::sourceRemoveId(const WebKit::WebString& id) { |
| 638 DCHECK(!id.isEmpty()); | 663 DCHECK(!id.isEmpty()); |
| 639 proxy_->DemuxerRemoveId(id.utf8().data()); | 664 chunk_demuxer_->RemoveId(id.utf8().data()); |
| 640 return true; | 665 return true; |
| 641 } | 666 } |
| 642 | 667 |
| 643 WebKit::WebTimeRanges WebMediaPlayerImpl::sourceBuffered( | 668 WebKit::WebTimeRanges WebMediaPlayerImpl::sourceBuffered( |
| 644 const WebKit::WebString& id) { | 669 const WebKit::WebString& id) { |
| 645 return ConvertToWebTimeRanges(proxy_->DemuxerBufferedRange(id.utf8().data())); | 670 return ConvertToWebTimeRanges( |
| 671 chunk_demuxer_->GetBufferedRanges(id.utf8().data())); |
| 646 } | 672 } |
| 647 | 673 |
| 648 bool WebMediaPlayerImpl::sourceAppend(const WebKit::WebString& id, | 674 bool WebMediaPlayerImpl::sourceAppend(const WebKit::WebString& id, |
| 649 const unsigned char* data, | 675 const unsigned char* data, |
| 650 unsigned length) { | 676 unsigned length) { |
| 651 DCHECK_EQ(main_loop_, MessageLoop::current()); | 677 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 652 | 678 |
| 653 float old_duration = duration(); | 679 float old_duration = duration(); |
| 654 if (!proxy_->DemuxerAppend(id.utf8().data(), data, length)) | 680 if (!chunk_demuxer_->AppendData(id.utf8().data(), data, length)) |
| 655 return false; | 681 return false; |
| 656 | 682 |
| 657 if (old_duration != duration()) | 683 if (old_duration != duration()) |
| 658 GetClient()->durationChanged(); | 684 GetClient()->durationChanged(); |
| 659 | 685 |
| 660 return true; | 686 return true; |
| 661 } | 687 } |
| 662 | 688 |
| 663 bool WebMediaPlayerImpl::sourceAbort(const WebKit::WebString& id) { | 689 bool WebMediaPlayerImpl::sourceAbort(const WebKit::WebString& id) { |
| 664 proxy_->DemuxerAbort(id.utf8().data()); | 690 chunk_demuxer_->Abort(id.utf8().data()); |
| 665 return true; | 691 return true; |
| 666 } | 692 } |
| 667 | 693 |
| 668 void WebMediaPlayerImpl::sourceSetDuration(double new_duration) { | 694 void WebMediaPlayerImpl::sourceSetDuration(double new_duration) { |
| 669 if (static_cast<double>(duration()) == new_duration) | 695 if (static_cast<double>(duration()) == new_duration) |
| 670 return; | 696 return; |
| 671 | 697 |
| 672 proxy_->DemuxerSetDuration( | 698 chunk_demuxer_->SetDuration( |
| 673 base::TimeDelta::FromMicroseconds( | 699 base::TimeDelta::FromMicroseconds( |
| 674 new_duration * base::Time::kMicrosecondsPerSecond)); | 700 new_duration * base::Time::kMicrosecondsPerSecond)); |
| 675 GetClient()->durationChanged(); | 701 GetClient()->durationChanged(); |
| 676 } | 702 } |
| 677 | 703 |
| 678 void WebMediaPlayerImpl::sourceEndOfStream( | 704 void WebMediaPlayerImpl::sourceEndOfStream( |
| 679 WebMediaPlayer::EndOfStreamStatus status) { | 705 WebMediaPlayer::EndOfStreamStatus status) { |
| 680 DCHECK_EQ(main_loop_, MessageLoop::current()); | 706 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 681 media::PipelineStatus pipeline_status = media::PIPELINE_OK; | 707 media::PipelineStatus pipeline_status = media::PIPELINE_OK; |
| 682 | 708 |
| 683 switch (status) { | 709 switch (status) { |
| 684 case WebMediaPlayer::EndOfStreamStatusNoError: | 710 case WebMediaPlayer::EndOfStreamStatusNoError: |
| 685 break; | 711 break; |
| 686 case WebMediaPlayer::EndOfStreamStatusNetworkError: | 712 case WebMediaPlayer::EndOfStreamStatusNetworkError: |
| 687 pipeline_status = media::PIPELINE_ERROR_NETWORK; | 713 pipeline_status = media::PIPELINE_ERROR_NETWORK; |
| 688 break; | 714 break; |
| 689 case WebMediaPlayer::EndOfStreamStatusDecodeError: | 715 case WebMediaPlayer::EndOfStreamStatusDecodeError: |
| 690 pipeline_status = media::PIPELINE_ERROR_DECODE; | 716 pipeline_status = media::PIPELINE_ERROR_DECODE; |
| 691 break; | 717 break; |
| 692 default: | 718 default: |
| 693 NOTIMPLEMENTED(); | 719 NOTIMPLEMENTED(); |
| 694 } | 720 } |
| 695 | 721 |
| 696 float old_duration = duration(); | 722 float old_duration = duration(); |
| 697 proxy_->DemuxerEndOfStream(pipeline_status); | 723 chunk_demuxer_->EndOfStream(pipeline_status); |
| 698 | 724 |
| 699 if (old_duration != duration()) | 725 if (old_duration != duration()) |
| 700 GetClient()->durationChanged(); | 726 GetClient()->durationChanged(); |
| 701 } | 727 } |
| 702 | 728 |
| 703 bool WebMediaPlayerImpl::sourceSetTimestampOffset(const WebKit::WebString& id, | 729 bool WebMediaPlayerImpl::sourceSetTimestampOffset(const WebKit::WebString& id, |
| 704 double offset) { | 730 double offset) { |
| 705 base::TimeDelta time_offset = base::TimeDelta::FromMicroseconds( | 731 base::TimeDelta time_offset = base::TimeDelta::FromMicroseconds( |
| 706 offset * base::Time::kMicrosecondsPerSecond); | 732 offset * base::Time::kMicrosecondsPerSecond); |
| 707 return proxy_->DemuxerSetTimestampOffset(id.utf8().data(), time_offset); | 733 return chunk_demuxer_->SetTimestampOffset(id.utf8().data(), time_offset); |
| 708 } | 734 } |
| 709 | 735 |
| 710 WebKit::WebMediaPlayer::MediaKeyException | 736 WebKit::WebMediaPlayer::MediaKeyException |
| 711 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, | 737 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, |
| 712 const unsigned char* init_data, | 738 const unsigned char* init_data, |
| 713 unsigned init_data_length) { | 739 unsigned init_data_length) { |
| 714 if (!IsSupportedKeySystem(key_system)) | 740 if (!IsSupportedKeySystem(key_system)) |
| 715 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 741 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
| 716 | 742 |
| 717 // We do not support run-time switching between key systems for now. | 743 // We do not support run-time switching between key systems for now. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); | 910 SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); |
| 885 break; | 911 break; |
| 886 } | 912 } |
| 887 | 913 |
| 888 // Repaint to trigger UI update. | 914 // Repaint to trigger UI update. |
| 889 Repaint(); | 915 Repaint(); |
| 890 } | 916 } |
| 891 | 917 |
| 892 void WebMediaPlayerImpl::OnDemuxerOpened() { | 918 void WebMediaPlayerImpl::OnDemuxerOpened() { |
| 893 DCHECK_EQ(main_loop_, MessageLoop::current()); | 919 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 894 | |
| 895 GetClient()->sourceOpened(); | 920 GetClient()->sourceOpened(); |
| 896 } | 921 } |
| 897 | 922 |
| 898 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, | 923 void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system, |
| 899 const std::string& session_id) { | 924 const std::string& session_id) { |
| 900 DCHECK_EQ(main_loop_, MessageLoop::current()); | 925 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 901 | 926 |
| 902 GetClient()->keyAdded(WebString::fromUTF8(key_system), | 927 GetClient()->keyAdded(WebString::fromUTF8(key_system), |
| 903 WebString::fromUTF8(session_id)); | 928 WebString::fromUTF8(session_id)); |
| 904 } | 929 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 GetClient()->readyStateChanged(); | 1045 GetClient()->readyStateChanged(); |
| 1021 } | 1046 } |
| 1022 | 1047 |
| 1023 void WebMediaPlayerImpl::Destroy() { | 1048 void WebMediaPlayerImpl::Destroy() { |
| 1024 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1049 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1025 | 1050 |
| 1026 // Tell the data source to abort any pending reads so that the pipeline is | 1051 // Tell the data source to abort any pending reads so that the pipeline is |
| 1027 // not blocked when issuing stop commands to the other filters. | 1052 // not blocked when issuing stop commands to the other filters. |
| 1028 if (proxy_) { | 1053 if (proxy_) { |
| 1029 proxy_->AbortDataSource(); | 1054 proxy_->AbortDataSource(); |
| 1030 proxy_->DemuxerShutdown(); | 1055 if (chunk_demuxer_) { |
| 1056 chunk_demuxer_->Shutdown(); |
| 1057 chunk_demuxer_ = NULL; |
| 1058 } |
| 1031 } | 1059 } |
| 1032 | 1060 |
| 1033 // Make sure to kill the pipeline so there's no more media threads running. | 1061 // Make sure to kill the pipeline so there's no more media threads running. |
| 1034 // Note: stopping the pipeline might block for a long time. | 1062 // Note: stopping the pipeline might block for a long time. |
| 1035 base::WaitableEvent waiter(false, false); | 1063 base::WaitableEvent waiter(false, false); |
| 1036 pipeline_->Stop(base::Bind( | 1064 pipeline_->Stop(base::Bind( |
| 1037 &base::WaitableEvent::Signal, base::Unretained(&waiter))); | 1065 &base::WaitableEvent::Signal, base::Unretained(&waiter))); |
| 1038 waiter.Wait(); | 1066 waiter.Wait(); |
| 1039 | 1067 |
| 1040 // Let V8 know we are not using extra resources anymore. | 1068 // Let V8 know we are not using extra resources anymore. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1063 return audio_source_provider_; | 1091 return audio_source_provider_; |
| 1064 } | 1092 } |
| 1065 | 1093 |
| 1066 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1094 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 1067 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1095 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1068 incremented_externally_allocated_memory_ = true; | 1096 incremented_externally_allocated_memory_ = true; |
| 1069 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1097 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 1070 } | 1098 } |
| 1071 | 1099 |
| 1072 } // namespace webkit_media | 1100 } // namespace webkit_media |
| OLD | NEW |