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

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: comments resolved 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
Index: webkit/media/webmediaplayer_impl.cc
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index 12d277b9fa2bbd3337e501c5517f7d4199b62fcf..488a263ca6e7b0b18f6b79c12fb10b78aa0b039f 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 == 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(),

Powered by Google App Engine
This is Rietveld 408576698