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 CONTENT_RENDERER_MEDIA_CRYPTO_CONTENT_DECRYPTION_MODULE_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_RENDER_CDM_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_CONTENT_DECRYPTION_MODULE_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_RENDER_CDM_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "media/base/cdm_factory.h" | |
11 #include "media/base/media_keys.h" | 12 #include "media/base/media_keys.h" |
12 | 13 |
13 #if defined(ENABLE_PEPPER_CDMS) | 14 #if defined(ENABLE_PEPPER_CDMS) |
14 #include "content/renderer/media/crypto/pepper_cdm_wrapper.h" | 15 #include "content/renderer/media/crypto/pepper_cdm_wrapper.h" |
15 #endif | 16 #endif |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 #if defined(ENABLE_BROWSER_CDMS) | 22 #if defined(ENABLE_BROWSER_CDMS) |
22 class RendererCdmManager; | 23 class RendererCdmManager; |
23 #endif | 24 #endif |
24 | 25 |
25 class ContentDecryptionModuleFactory { | 26 class RenderCdmFactory : public media::CdmFactory { |
26 public: | 27 public: |
27 // |create_pepper_cdm_cb| will be called synchronously if necessary. The other | 28 #if defined(ENABLE_PEPPER_CDMS) |
28 // callbacks can be called asynchronously. | 29 explicit RenderCdmFactory(const CreatePepperCdmCB& create_pepper_cdm_cb); |
29 static scoped_ptr<media::MediaKeys> Create( | 30 #elif defined(ENABLE_BROWSER_CDMS) |
31 explicit RenderCdmFactory(RendererCdmManager* manager); | |
32 #else | |
33 RenderCdmFactory(); | |
34 #endif // defined(ENABLE_PEPPER_CDMS) | |
35 | |
36 virtual ~RenderCdmFactory(); | |
37 | |
38 virtual scoped_ptr<media::MediaKeys> Create( | |
30 const std::string& key_system, | 39 const std::string& key_system, |
31 const GURL& security_origin, | 40 const GURL& security_origin, |
32 #if defined(ENABLE_PEPPER_CDMS) | 41 #if defined(ENABLE_BROWSER_CDMS) |
33 const CreatePepperCdmCB& create_pepper_cdm_cb, | 42 int* cdm_id, |
34 #elif defined(ENABLE_BROWSER_CDMS) | 43 #endif |
35 RendererCdmManager* manager, | |
36 int* cdm_id, // Output parameter indicating the CDM ID of the MediaKeys. | |
37 #endif // defined(ENABLE_PEPPER_CDMS) | |
38 const media::SessionMessageCB& session_message_cb, | 44 const media::SessionMessageCB& session_message_cb, |
39 const media::SessionReadyCB& session_ready_cb, | 45 const media::SessionReadyCB& session_ready_cb, |
40 const media::SessionClosedCB& session_closed_cb, | 46 const media::SessionClosedCB& session_closed_cb, |
41 const media::SessionErrorCB& session_error_cb, | 47 const media::SessionErrorCB& session_error_cb, |
42 const media::SessionKeysChangeCB& session_keys_change_cb, | 48 const media::SessionKeysChangeCB& session_keys_change_cb, |
43 const media::SessionExpirationUpdateCB& session_expiration_update_cb); | 49 const media::SessionExpirationUpdateCB& session_expiration_update_cb) |
50 const override; | |
51 | |
52 private: | |
53 #if defined(ENABLE_PEPPER_CDMS) | |
54 const CreatePepperCdmCB create_pepper_cdm_cb_; | |
55 #elif defined(ENABLE_BROWSER_CDMS) | |
56 RendererCdmManager* const manager_; | |
ddorwin
2014/10/17 01:41:55
This is technically correct and will compile, but
xhwang
2014/10/17 03:54:21
Done.
| |
57 #endif | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(RenderCdmFactory); | |
44 }; | 60 }; |
45 | 61 |
46 } // namespace content | 62 } // namespace content |
47 | 63 |
48 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_CONTENT_DECRYPTION_MODULE_FACTORY_H_ | 64 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_RENDER_CDM_FACTORY_H_ |
OLD | NEW |