diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 22:44:48 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 22:44:48 +0000 |
commit | 747ca431003f9b1a3f09af01484931888c066164 (patch) | |
tree | e2baac68936b8820be3f8654900285255340f2cb /webkit | |
parent | be967dabc052a642585653c5f0ae2bb505ad807a (diff) | |
download | chromium_src-747ca431003f9b1a3f09af01484931888c066164.zip chromium_src-747ca431003f9b1a3f09af01484931888c066164.tar.gz chromium_src-747ca431003f9b1a3f09af01484931888c066164.tar.bz2 |
Use WebKit::WebVector instead of std::vector in WebKit::WebMediaPlayer
Get rid of the use of std::vector.
Review URL: http://codereview.chromium.org/259053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/api/public/WebMediaPlayer.h | 6 | ||||
-rw-r--r-- | webkit/api/src/WebMediaPlayerClientImpl.cpp | 2 | ||||
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 9 |
3 files changed, 9 insertions, 8 deletions
diff --git a/webkit/api/public/WebMediaPlayer.h b/webkit/api/public/WebMediaPlayer.h index b6df8bc..c6320d1 100644 --- a/webkit/api/public/WebMediaPlayer.h +++ b/webkit/api/public/WebMediaPlayer.h @@ -31,9 +31,8 @@ #ifndef WebMediaPlayer_h #define WebMediaPlayer_h -#include <vector> - #include "WebCanvas.h" +#include "WebVector.h" namespace WebKit { class WebMediaPlayerClient; @@ -42,13 +41,14 @@ namespace WebKit { struct WebSize; struct WebTimeRange { + WebTimeRange() : start(0), end(0) {} WebTimeRange(float s, float e) : start(s), end(e) {} float start; float end; }; - typedef std::vector<WebTimeRange> WebTimeRanges; + typedef WebVector<WebTimeRange> WebTimeRanges; class WebMediaPlayer { public: diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp index 3cb82c6..c7d6d3b 100644 --- a/webkit/api/src/WebMediaPlayerClientImpl.cpp +++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp @@ -256,7 +256,7 @@ float WebMediaPlayerClientImpl::maxTimeSeekable() const WTF::PassRefPtr<WebCore::TimeRanges> WebMediaPlayerClientImpl::buffered() const { if (m_webMediaPlayer.get()) { - WebTimeRanges webRanges = m_webMediaPlayer->buffered(); + const WebTimeRanges& webRanges = m_webMediaPlayer->buffered(); // FIXME: Save the time ranges in a member variable and update it when needed. WTF::RefPtr<TimeRanges> ranges = TimeRanges::create(); diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index 1369f42..7bf5c1e 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -505,10 +505,11 @@ void WebMediaPlayerImpl::OnPipelineInitialize() { DCHECK(MessageLoop::current() == main_loop_); if (pipeline_->GetError() == media::PIPELINE_OK) { // Only keep one time range starting from 0. - buffered_.push_back( - WebKit::WebTimeRange( - 0.0f, - static_cast<float>(pipeline_->GetBufferedTime().InSecondsF()))); + WebKit::WebTimeRanges new_buffered(static_cast<size_t>(1)); + new_buffered[0].start = 0.0f; + new_buffered[0].end = + static_cast<float>(pipeline_->GetBufferedTime().InSecondsF()); + buffered_.swap(new_buffered); // Since we have initialized the pipeline, say we have everything. // TODO(hclam): change this to report the correct status. |