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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 11313016: Add "type" in GenerateKeyRequest() and OnNeedKey(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the DCHECK where init_data_type_ is set but NeedKey from decoder passes empty "type". Created 8 years, 2 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
« no previous file with comments | « webkit/media/webmediaplayer_impl.h ('k') | webkit/media/webmediaplayer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_impl.cc
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index 12d277b9fa2bbd3337e501c5517f7d4199b62fcf..87e1079e20ec648f4de8eee563212ab09dccc61a 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -799,7 +799,11 @@ WebMediaPlayerImpl::GenerateKeyRequestInternal(
<< std::string(reinterpret_cast<const char*>(init_data),
static_cast<size_t>(init_data_length));
+ // TODO(xhwang): We assume all streams are from the same container (thus have
+ // the same "type") for now. In the future, the "type" should be passed down
+ // from the application.
if (!decryptor_.GenerateKeyRequest(key_system.utf8(),
+ init_data_type_,
init_data, init_data_length)) {
current_key_system_.reset();
return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported;
@@ -1013,12 +1017,17 @@ void WebMediaPlayerImpl::OnKeyAdded(const std::string& key_system,
void WebMediaPlayerImpl::OnNeedKey(const std::string& key_system,
const std::string& session_id,
+ const std::string& type,
scoped_array<uint8> init_data,
int init_data_size) {
DCHECK_EQ(main_loop_, MessageLoop::current());
UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1);
+ DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_);
+ if (init_data_type_.empty())
+ init_data_type_ = type;
+
GetClient()->keyNeeded(WebString::fromUTF8(key_system),
WebString::fromUTF8(session_id),
init_data.get(),
« no previous file with comments | « webkit/media/webmediaplayer_impl.h ('k') | webkit/media/webmediaplayer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698