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

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

Issue 9225001: Remove two static initializers (media/base/{buffers,media_log}.cc) (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
OLDNEW
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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 return seeking_; 473 return seeking_;
474 } 474 }
475 475
476 float WebMediaPlayerImpl::duration() const { 476 float WebMediaPlayerImpl::duration() const {
477 DCHECK_EQ(main_loop_, MessageLoop::current()); 477 DCHECK_EQ(main_loop_, MessageLoop::current());
478 478
479 base::TimeDelta duration = pipeline_->GetMediaDuration(); 479 base::TimeDelta duration = pipeline_->GetMediaDuration();
480 480
481 // Return positive infinity if the resource is unbounded. 481 // Return positive infinity if the resource is unbounded.
482 // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom- media-duration 482 // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom- media-duration
483 if (duration == media::kInfiniteDuration) 483 if (duration == media::kInfiniteDuration())
484 return std::numeric_limits<float>::infinity(); 484 return std::numeric_limits<float>::infinity();
485 485
486 return static_cast<float>(duration.InSecondsF()); 486 return static_cast<float>(duration.InSecondsF());
487 } 487 }
488 488
489 float WebMediaPlayerImpl::currentTime() const { 489 float WebMediaPlayerImpl::currentTime() const {
490 DCHECK_EQ(main_loop_, MessageLoop::current()); 490 DCHECK_EQ(main_loop_, MessageLoop::current());
491 if (paused_) 491 if (paused_)
492 return static_cast<float>(paused_time_.InSecondsF()); 492 return static_cast<float>(paused_time_.InSecondsF());
493 return static_cast<float>(pipeline_->GetCurrentTime().InSecondsF()); 493 return static_cast<float>(pipeline_->GetCurrentTime().InSecondsF());
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 return audio_source_provider_; 916 return audio_source_provider_;
917 } 917 }
918 918
919 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 919 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
920 DCHECK_EQ(main_loop_, MessageLoop::current()); 920 DCHECK_EQ(main_loop_, MessageLoop::current());
921 incremented_externally_allocated_memory_ = true; 921 incremented_externally_allocated_memory_ = true;
922 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 922 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
923 } 923 }
924 924
925 } // namespace webkit_media 925 } // namespace webkit_media
OLDNEW
« media/base/media_log.cc ('K') | « webkit/media/video_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698