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

Unified Diff: content/renderer/media/webcontentdecryptionmodule_impl.h

Issue 555223004: Update MediaKeys interface for EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reorder Created 6 years, 3 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: content/renderer/media/webcontentdecryptionmodule_impl.h
diff --git a/content/renderer/media/webcontentdecryptionmodule_impl.h b/content/renderer/media/webcontentdecryptionmodule_impl.h
index 2619e5610b3eeea3a0ca232bd018536aac3a85e5..50d662542c89d23a6fc4ab3f03aff787d612098b 100644
--- a/content/renderer/media/webcontentdecryptionmodule_impl.h
+++ b/content/renderer/media/webcontentdecryptionmodule_impl.h
@@ -9,7 +9,9 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
+#include "content/renderer/media/webcontentdecryptionmoduleresult_helper.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModule.h"
namespace blink {
@@ -64,12 +66,32 @@ class WebContentDecryptionModuleImpl
virtual blink::WebContentDecryptionModuleSession* createSession(
blink::WebContentDecryptionModuleSession::Client* client);
+ virtual void setServerCertificate(
+ const uint8* server_certificate,
+ size_t server_certificate_length,
+ blink::WebContentDecryptionModuleResult result);
+
private:
// Takes reference to |adapter|.
WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter);
+ // Used when setServerCertificate() promise is resolved/rejected.
+ void OnPromiseResolved(uint32 result_index);
ddorwin 2014/09/11 23:31:11 We should be consistent. If we don't intend to cha
ddorwin 2014/09/12 21:46:29 It appears we *do* want to use "On", which would m
jrummell 2014/09/15 18:22:39 Acknowledged.
+ void OnPromiseRejected(uint32 result_index,
+ media::MediaKeys::Exception exception_code,
+ uint32 system_code,
+ const std::string& error_message);
+
scoped_refptr<CdmSessionAdapter> adapter_;
+ // Keep track of all the outstanding WebContentDecryptionModuleResult objects.
+ WebContentDecryptionModuleResultHelper outstanding_results_;
+
+ // Since promises will live until they are fired, use a weak reference when
+ // creating a promise in case this class disappears before the promise
+ // actually fires.
+ base::WeakPtrFactory<WebContentDecryptionModuleImpl> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl);
};

Powered by Google App Engine
This is Rietveld 408576698