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

Unified Diff: webkit/media/crypto/proxy_decryptor.cc

Issue 10896014: Add a bool return value to media::Decryptor::GenerateKeyRequest(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve comments. Created 8 years, 4 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/crypto/proxy_decryptor.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/proxy_decryptor.cc
diff --git a/webkit/media/crypto/proxy_decryptor.cc b/webkit/media/crypto/proxy_decryptor.cc
index 203c1466fb78290b3d23f093f35c0f1f638ab712..bdbabbf21fe8095577573c9c672870ae281110f3 100644
--- a/webkit/media/crypto/proxy_decryptor.cc
+++ b/webkit/media/crypto/proxy_decryptor.cc
@@ -72,7 +72,7 @@ ProxyDecryptor::ProxyDecryptor(
ProxyDecryptor::~ProxyDecryptor() {
}
-void ProxyDecryptor::GenerateKeyRequest(const std::string& key_system,
+bool ProxyDecryptor::GenerateKeyRequest(const std::string& key_system,
const uint8* init_data,
int init_data_length) {
// We do not support run-time switching of decryptors. GenerateKeyRequest()
@@ -85,10 +85,15 @@ void ProxyDecryptor::GenerateKeyRequest(const std::string& key_system,
if (!decryptor_.get()) {
client_->KeyError(key_system, "", media::Decryptor::kUnknownError, 0);
- return;
+ return false;
+ }
+
+ if(!decryptor_->GenerateKeyRequest(key_system, init_data, init_data_length)) {
+ decryptor_.reset();
+ return false;
}
- decryptor_->GenerateKeyRequest(key_system, init_data, init_data_length);
+ return true;
}
void ProxyDecryptor::AddKey(const std::string& key_system,
@@ -162,7 +167,7 @@ void ProxyDecryptor::Decrypt(
}
void ProxyDecryptor::Stop() {
- DVLOG(1) << "AddKey()";
+ DVLOG(1) << "Stop()";
std::vector<base::Closure> closures_to_run;
{
« no previous file with comments | « webkit/media/crypto/proxy_decryptor.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698