| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 15 #include "media/blink/media_blink_export.h" | 16 #include "media/blink/media_blink_export.h" |
| 16 #include "third_party/WebKit/public/platform/WebContentDecryptionModule.h" | 17 #include "third_party/WebKit/public/platform/WebContentDecryptionModule.h" |
| 17 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | 18 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
| 18 | 19 |
| 19 namespace blink { | 20 namespace blink { |
| 20 #if defined(ENABLE_PEPPER_CDMS) | 21 #if defined(ENABLE_PEPPER_CDMS) |
| 21 class WebLocalFrame; | 22 class WebLocalFrame; |
| 22 #endif | 23 #endif |
| 23 class WebSecurityOrigin; | 24 class WebSecurityOrigin; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace media { | 27 namespace media { |
| 27 | 28 |
| 28 struct CdmConfig; | 29 struct CdmConfig; |
| 29 class CdmContext; | 30 class CdmContext; |
| 30 class CdmFactory; | 31 class CdmFactory; |
| 31 class CdmSessionAdapter; | 32 class CdmSessionAdapter; |
| 32 class WebContentDecryptionModuleSessionImpl; | 33 class WebContentDecryptionModuleSessionImpl; |
| 33 | 34 |
| 34 class MEDIA_BLINK_EXPORT WebContentDecryptionModuleImpl | 35 class MEDIA_BLINK_EXPORT WebContentDecryptionModuleImpl |
| 35 : public blink::WebContentDecryptionModule { | 36 : public blink::WebContentDecryptionModule { |
| 36 public: | 37 public: |
| 37 static void Create( | 38 static void Create( |
| 38 CdmFactory* cdm_factory, | 39 CdmFactory* cdm_factory, |
| 39 const base::string16& key_system, | 40 const base::string16& key_system, |
| 40 const blink::WebSecurityOrigin& security_origin, | 41 const blink::WebSecurityOrigin& security_origin, |
| 41 const CdmConfig& cdm_config, | 42 const CdmConfig& cdm_config, |
| 42 scoped_ptr<blink::WebContentDecryptionModuleResult> result); | 43 std::unique_ptr<blink::WebContentDecryptionModuleResult> result); |
| 43 | 44 |
| 44 ~WebContentDecryptionModuleImpl() override; | 45 ~WebContentDecryptionModuleImpl() override; |
| 45 | 46 |
| 46 // blink::WebContentDecryptionModule implementation. | 47 // blink::WebContentDecryptionModule implementation. |
| 47 blink::WebContentDecryptionModuleSession* createSession() override; | 48 blink::WebContentDecryptionModuleSession* createSession() override; |
| 48 | 49 |
| 49 void setServerCertificate( | 50 void setServerCertificate( |
| 50 const uint8_t* server_certificate, | 51 const uint8_t* server_certificate, |
| 51 size_t server_certificate_length, | 52 size_t server_certificate_length, |
| 52 blink::WebContentDecryptionModuleResult result) override; | 53 blink::WebContentDecryptionModuleResult result) override; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 69 | 70 |
| 70 // Allow typecasting from blink type as this is the only implementation. | 71 // Allow typecasting from blink type as this is the only implementation. |
| 71 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 72 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
| 72 blink::WebContentDecryptionModule* cdm) { | 73 blink::WebContentDecryptionModule* cdm) { |
| 73 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 74 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
| 74 } | 75 } |
| 75 | 76 |
| 76 } // namespace media | 77 } // namespace media |
| 77 | 78 |
| 78 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 79 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| OLD | NEW |