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

Unified Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 518523002: Handle incorrect promise resolving (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/content_decryptor_delegate.cc
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc
index 840efa42e90f2c40cacfd959689c4eef324ae8d0..f7d2c319d159da68a380ad8295e17b39bada4953 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -625,6 +625,18 @@ bool ContentDecryptorDelegate::DecryptAndDecodeVideo(
void ContentDecryptorDelegate::OnPromiseResolved(uint32 promise_id) {
scoped_ptr<CdmPromise> promise = TakePromise(promise_id);
+
+ // Special case due to http://crbug.com/408330. CDM is resolving LoadSession()
+ // with this method when the session is not found. Instead it should call
+ // PromiseResolvedWithSession(""), so emulate that here until 408330 is fixed.
xhwang 2014/08/28 20:33:51 nit: add a TODO so that we don't forget to remove
jrummell 2014/08/28 21:26:27 Done.
+ if (promise &&
+ promise->GetResolveParameterType() == media::CdmPromise::STRING_TYPE) {
+ NewSessionCdmPromise* session_promise(
+ static_cast<NewSessionCdmPromise*>(promise.get()));
+ session_promise->resolve(std::string());
+ return;
+ }
+
if (!promise ||
promise->GetResolveParameterType() != media::CdmPromise::VOID_TYPE) {
NOTREACHED();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698