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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 759933003: Move OnNeedKey() to WebMediaPlayerImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years 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: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 4120b36ea22b0e8dff064230919fe0addf882b85..c2f0dd6d64769ba3dc43c480788fb75921cbc532 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -1731,7 +1731,7 @@ void WebMediaPlayerAndroid::OnMediaSourceOpened(
client_->mediaSourceOpened(web_media_source);
}
-void WebMediaPlayerAndroid::OnNeedKey(const std::string& type,
+void WebMediaPlayerAndroid::OnNeedKey(const std::string& init_data_type,
const std::vector<uint8>& init_data) {
DCHECK(main_thread_checker_.CalledOnValidThread());
@@ -1743,13 +1743,16 @@ void WebMediaPlayerAndroid::OnNeedKey(const std::string& type,
UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1);
- DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_);
+ DCHECK(!init_data_type.empty());
+ DLOG_IF(WARNING,
+ !init_data_type_.empty() && init_data_type != init_data_type_)
+ << "Mixed init data type not supported. The new type is ignored.";
if (init_data_type_.empty())
- init_data_type_ = type;
+ init_data_type_ = init_data_type;
const uint8* init_data_ptr = init_data.empty() ? NULL : &init_data[0];
- client_->encrypted(
- WebString::fromUTF8(type), init_data_ptr, init_data.size());
+ client_->encrypted(WebString::fromUTF8(init_data_type), init_data_ptr,
+ init_data.size());
}
void WebMediaPlayerAndroid::SetDecryptorReadyCB(
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | media/blink/encrypted_media_player_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698