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_CDM_RENDER_CDM_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CDM_RENDER_CDM_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_CDM_RENDER_CDM_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_CDM_RENDER_CDM_FACTORY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "media/base/cdm_factory.h" | 13 #include "media/base/cdm_factory.h" |
14 #include "media/base/media_keys.h" | 14 #include "media/base/media_keys.h" |
| 15 #include "ppapi/features/features.h" |
15 | 16 |
16 #if defined(ENABLE_PEPPER_CDMS) | 17 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
17 #include "content/renderer/media/cdm/pepper_cdm_wrapper.h" | 18 #include "content/renderer/media/cdm/pepper_cdm_wrapper.h" |
18 #endif | 19 #endif |
19 | 20 |
20 class GURL; | 21 class GURL; |
21 | 22 |
22 namespace media { | 23 namespace media { |
23 struct CdmConfig; | 24 struct CdmConfig; |
24 } // namespace media | 25 } // namespace media |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
28 // CdmFactory implementation in content/renderer. This class is not thread safe | 29 // CdmFactory implementation in content/renderer. This class is not thread safe |
29 // and should only be used on one thread. | 30 // and should only be used on one thread. |
30 class RenderCdmFactory : public media::CdmFactory { | 31 class RenderCdmFactory : public media::CdmFactory { |
31 public: | 32 public: |
32 #if defined(ENABLE_PEPPER_CDMS) | 33 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
33 explicit RenderCdmFactory(const CreatePepperCdmCB& create_pepper_cdm_cb); | 34 explicit RenderCdmFactory(const CreatePepperCdmCB& create_pepper_cdm_cb); |
34 #else | 35 #else |
35 RenderCdmFactory(); | 36 RenderCdmFactory(); |
36 #endif // defined(ENABLE_PEPPER_CDMS) | 37 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
37 | 38 |
38 ~RenderCdmFactory() override; | 39 ~RenderCdmFactory() override; |
39 | 40 |
40 // CdmFactory implementation. | 41 // CdmFactory implementation. |
41 void Create( | 42 void Create( |
42 const std::string& key_system, | 43 const std::string& key_system, |
43 const GURL& security_origin, | 44 const GURL& security_origin, |
44 const media::CdmConfig& cdm_config, | 45 const media::CdmConfig& cdm_config, |
45 const media::SessionMessageCB& session_message_cb, | 46 const media::SessionMessageCB& session_message_cb, |
46 const media::SessionClosedCB& session_closed_cb, | 47 const media::SessionClosedCB& session_closed_cb, |
47 const media::SessionKeysChangeCB& session_keys_change_cb, | 48 const media::SessionKeysChangeCB& session_keys_change_cb, |
48 const media::SessionExpirationUpdateCB& session_expiration_update_cb, | 49 const media::SessionExpirationUpdateCB& session_expiration_update_cb, |
49 const media::CdmCreatedCB& cdm_created_cb) override; | 50 const media::CdmCreatedCB& cdm_created_cb) override; |
50 | 51 |
51 private: | 52 private: |
52 #if defined(ENABLE_PEPPER_CDMS) | 53 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
53 CreatePepperCdmCB create_pepper_cdm_cb_; | 54 CreatePepperCdmCB create_pepper_cdm_cb_; |
54 #endif | 55 #endif |
55 | 56 |
56 base::ThreadChecker thread_checker_; | 57 base::ThreadChecker thread_checker_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(RenderCdmFactory); | 59 DISALLOW_COPY_AND_ASSIGN(RenderCdmFactory); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace content | 62 } // namespace content |
62 | 63 |
63 #endif // CONTENT_RENDERER_MEDIA_CDM_RENDER_CDM_FACTORY_H_ | 64 #endif // CONTENT_RENDERER_MEDIA_CDM_RENDER_CDM_FACTORY_H_ |
OLD | NEW |