Chromium Code Reviews| 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..3b55803fc6b99d1794320869914dd33f25099d58 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. |
|
ddorwin
2014/09/10 22:58:38
Why isn't this handled as a "Result"?
jrummell
2014/09/11 21:21:55
On the Chromium side we switch to CdmPromise, so t
|
| + void CertificateSet(uint32 result_index); |
|
ddorwin
2014/09/10 22:58:38
On...?
ditto below
jrummell
2014/09/11 21:21:55
Done.
|
| + void SessionError(uint32 result_index, |
|
ddorwin
2014/09/10 22:58:39
Why does the CDM object handle a session error?
jrummell
2014/09/11 21:21:55
This is the promise rejected. Renamed.
|
| + 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); |
| }; |