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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 10066019: Implement sourceAddId() & sourceRemoveId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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: webkit/media/webmediaplayer_impl.cc
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index e5afb5d04cf465be009f49053a6fa792c62447df..f1d7c7a9a876f43cea590531d0aedbe3c89db1f4 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -641,10 +641,36 @@ void WebMediaPlayerImpl::putCurrentFrame(
}
}
+WebKit::WebMediaPlayer::AddIdStatus WebMediaPlayerImpl::sourceAddId(
+ const WebKit::WebString& id,
+ const WebKit::WebString& type) {
+ DCHECK_EQ(main_loop_, MessageLoop::current());
+ DCHECK(!id.isEmpty());
scherkus (not reviewing) 2012/04/12 20:58:32 are these actually DCHECK worthy? are we protecte
acolwell GONE FROM CHROMIUM 2012/04/12 22:43:12 Done.
+ DCHECK(!type.isEmpty());
+
+ return static_cast<WebKit::WebMediaPlayer::AddIdStatus>(
scherkus (not reviewing) 2012/04/12 20:58:32 do we have compile asserts to back the static_cast
acolwell GONE FROM CHROMIUM 2012/04/12 22:43:12 Done.
+ proxy_->DemuxerAddId(id.utf8().data(), type.utf8().data()));
+}
+
+void WebMediaPlayerImpl::sourceRemoveId(const WebKit::WebString& id) {
+ DCHECK(!id.isEmpty());
+ proxy_->DemuxerRemoveId(id.utf8().data());
+}
+
bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data,
unsigned length) {
+ return sourceAppend(WebKit::WebString::fromUTF8("DefaultSourceId"),
+ data, length);
+}
+
+bool WebMediaPlayerImpl::sourceAppend(const WebKit::WebString& id,
+ const unsigned char* data,
+ unsigned length) {
DCHECK_EQ(main_loop_, MessageLoop::current());
- return proxy_->DemuxerAppend(data, length);
+ DCHECK(!id.isEmpty());
scherkus (not reviewing) 2012/04/12 20:58:32 ditto on these DCHECKs
acolwell GONE FROM CHROMIUM 2012/04/12 22:43:12 Done.
+ DCHECK(data);
+ DCHECK_GT(length, 0u);
+ return proxy_->DemuxerAppend(id.utf8().data(), data, length);
}
void WebMediaPlayerImpl::sourceEndOfStream(

Powered by Google App Engine
This is Rietveld 408576698