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

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 886393003: Handle createCDM() when frame destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: media/blink/webencryptedmediaclient_impl.cc
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc
index 5cd96116997aa52aa7a2cb72d17c93b97c6320a7..7dee9593c33877d46eadcb542349b0be3ba0bafb 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(
+ blink::WebSecurityOrigin security_origin,
+ blink::WebString key_system,
+ 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) {
« media/blink/webencryptedmediaclient_impl.h ('K') | « media/blink/webencryptedmediaclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698