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