Index: media/blink/webencryptedmediaclient_impl.cc |
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc |
index 5cd96116997aa52aa7a2cb72d17c93b97c6320a7..264d5c6d12b7013cb2978fd12ad531dcbc49b93b 100644 |
--- a/media/blink/webencryptedmediaclient_impl.cc |
+++ b/media/blink/webencryptedmediaclient_impl.cc |
@@ -15,6 +15,7 @@ |
#include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" |
#include "third_party/WebKit/public/platform/WebString.h" |
#include "third_party/WebKit/public/platform/WebVector.h" |
+#include "webcontentdecryptionmodule_impl.h" |
#include "webcontentdecryptionmoduleaccess_impl.h" |
namespace media { |
@@ -189,7 +190,7 @@ class WebEncryptedMediaClientImpl::Reporter { |
WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl( |
scoped_ptr<CdmFactory> cdm_factory, |
MediaPermission* media_permission) |
- : cdm_factory_(cdm_factory.Pass()) { |
+ : cdm_factory_(cdm_factory.Pass()), weak_factory_(this) { |
// TODO(sandersd): Use |media_permission| to check for media permissions in |
// this class. |
DCHECK(media_permission); |
@@ -237,7 +238,7 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
reporter->ReportSupported(); |
request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create( |
request.keySystem(), blink::WebMediaKeySystemConfiguration(), |
- request.securityOrigin(), cdm_factory_.get())); |
+ request.securityOrigin(), weak_factory_.GetWeakPtr())); |
return; |
} |
@@ -250,7 +251,7 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
reporter->ReportSupported(); |
request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create( |
request.keySystem(), accumulated_configuration, |
- request.securityOrigin(), cdm_factory_.get())); |
+ request.securityOrigin(), weak_factory_.GetWeakPtr())); |
return; |
} |
} |
@@ -260,6 +261,14 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
"None of the requested configurations were supported."); |
} |
+void WebEncryptedMediaClientImpl::CreateCdm( |
+ const blink::WebString& key_system, |
+ const blink::WebSecurityOrigin& security_origin, |
+ blink::WebContentDecryptionModuleResult result) { |
+ WebContentDecryptionModuleImpl::Create(cdm_factory_.get(), security_origin, |
+ key_system, result); |
+} |
+ |
// Lazily create Reporters. |
WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter( |
const std::string& key_system) { |