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

Unified Diff: media/mojo/services/media_resource_shim.cc

Issue 2668393002: Rename DemuxerStreamProvider into MediaResource (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
Index: media/mojo/services/media_resource_shim.cc
diff --git a/media/mojo/services/demuxer_stream_provider_shim.cc b/media/mojo/services/media_resource_shim.cc
similarity index 74%
rename from media/mojo/services/demuxer_stream_provider_shim.cc
rename to media/mojo/services/media_resource_shim.cc
index 1bb7e6025291d13f2d4debbd40a52898f678dc36..2d178922e888cdaedee03bcf2278be7ac53f6fa7 100644
--- a/media/mojo/services/demuxer_stream_provider_shim.cc
+++ b/media/mojo/services/media_resource_shim.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/mojo/services/demuxer_stream_provider_shim.h"
+#include "media/mojo/services/media_resource_shim.h"
#include <utility>
@@ -12,7 +12,7 @@
namespace media {
-DemuxerStreamProviderShim::DemuxerStreamProviderShim(
+MediaResourceShim::MediaResourceShim(
std::vector<mojom::DemuxerStreamPtr> streams,
const base::Closure& demuxer_ready_cb)
: demuxer_ready_cb_(demuxer_ready_cb),
@@ -23,17 +23,16 @@ DemuxerStreamProviderShim::DemuxerStreamProviderShim(
for (auto& s : streams) {
streams_.emplace_back(new MojoDemuxerStreamAdapter(
- std::move(s), base::Bind(&DemuxerStreamProviderShim::OnStreamReady,
+ std::move(s), base::Bind(&MediaResourceShim::OnStreamReady,
weak_factory_.GetWeakPtr())));
}
}
-DemuxerStreamProviderShim::~DemuxerStreamProviderShim() {
-}
+MediaResourceShim::~MediaResourceShim() {}
// This function returns only the first stream of the given |type| for now.
// TODO(servolk): Make this work with multiple streams.
-DemuxerStream* DemuxerStreamProviderShim::GetStream(DemuxerStream::Type type) {
+DemuxerStream* MediaResourceShim::GetStream(DemuxerStream::Type type) {
DCHECK(demuxer_ready_cb_.is_null());
for (auto& stream : streams_) {
if (stream->type() == type)
@@ -43,7 +42,7 @@ DemuxerStream* DemuxerStreamProviderShim::GetStream(DemuxerStream::Type type) {
return nullptr;
}
-void DemuxerStreamProviderShim::OnStreamReady() {
+void MediaResourceShim::OnStreamReady() {
if (++streams_ready_ == streams_.size())
base::ResetAndReturn(&demuxer_ready_cb_).Run();
}

Powered by Google App Engine
This is Rietveld 408576698