Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: webkit/media/webmediaplayer_impl.cc

Issue 9041016: Disable accelerated compositing for audio-only <video> tags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 // Only keep one time range starting from 0. 751 // Only keep one time range starting from 0.
752 WebKit::WebTimeRanges new_buffered(static_cast<size_t>(1)); 752 WebKit::WebTimeRanges new_buffered(static_cast<size_t>(1));
753 new_buffered[0].start = 0.0f; 753 new_buffered[0].start = 0.0f;
754 new_buffered[0].end = 754 new_buffered[0].end =
755 static_cast<float>(pipeline_->GetMediaDuration().InSecondsF()); 755 static_cast<float>(pipeline_->GetMediaDuration().InSecondsF());
756 buffered_.swap(new_buffered); 756 buffered_.swap(new_buffered);
757 757
758 if (hasVideo()) { 758 if (hasVideo()) {
759 UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", 759 UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive",
760 is_accelerated_compositing_active_); 760 is_accelerated_compositing_active_);
761 } else {
762 GetClient()->disableAcceleratedCompositing();
761 } 763 }
762 764
763 if (pipeline_->IsLocalSource()) 765 if (pipeline_->IsLocalSource())
764 SetNetworkState(WebKit::WebMediaPlayer::Loaded); 766 SetNetworkState(WebKit::WebMediaPlayer::Loaded);
765 767
766 SetReadyState(WebKit::WebMediaPlayer::HaveMetadata); 768 SetReadyState(WebKit::WebMediaPlayer::HaveMetadata);
767 // Fire canplaythrough immediately after playback begins because of 769 // Fire canplaythrough immediately after playback begins because of
768 // crbug.com/106480. 770 // crbug.com/106480.
769 // TODO(vrk): set ready state to HaveFutureData when bug above is fixed. 771 // TODO(vrk): set ready state to HaveFutureData when bug above is fixed.
770 SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData); 772 SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 return client_; 936 return client_;
935 } 937 }
936 938
937 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 939 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
938 DCHECK_EQ(main_loop_, MessageLoop::current()); 940 DCHECK_EQ(main_loop_, MessageLoop::current());
939 incremented_externally_allocated_memory_ = true; 941 incremented_externally_allocated_memory_ = true;
940 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 942 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
941 } 943 }
942 944
943 } // namespace webkit_media 945 } // namespace webkit_media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698