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

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: add todo 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..48ea4de9fa5b9be605d34b59ae82ab4b5e26430b 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -625,6 +625,19 @@ 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.
+ // TODO(jrummell): Remove this code when the CDM is updated.
+ if (promise &&
+ promise->GetResolveParameterType() == media::CdmPromise::STRING_TYPE) {
+ NewSessionCdmPromise* session_promise(
+ static_cast<NewSessionCdmPromise*>(promise.get()));
bbudge 2014/08/28 21:41:41 nit: The assignment syntax seems more common in Ch
jrummell 2014/08/28 21:52:24 Done (along with the other 2 similar instances).
+ 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