OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BASE_CDM_FACTORY_H_ | 5 #ifndef MEDIA_BASE_CDM_FACTORY_H_ |
6 #define MEDIA_BASE_CDM_FACTORY_H_ | 6 #define MEDIA_BASE_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/media_export.h" | 11 #include "media/base/media_export.h" |
12 #include "media/base/media_keys.h" | 12 #include "media/base/media_keys.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 namespace media { | 16 namespace media { |
17 | 17 |
| 18 using CdmCreatedCB = base::Callback<void(scoped_ptr<MediaKeys>)>; |
| 19 |
18 class MEDIA_EXPORT CdmFactory { | 20 class MEDIA_EXPORT CdmFactory { |
19 public: | 21 public: |
20 using CdmCreatedCB = base::Callback<void(scoped_ptr<MediaKeys>)>; | |
21 | |
22 CdmFactory(); | 22 CdmFactory(); |
23 virtual ~CdmFactory(); | 23 virtual ~CdmFactory(); |
24 | 24 |
25 // Creates a CDM for |key_system| and returns it through |cdm_created_cb| | 25 // Creates a CDM for |key_system| and returns it through |cdm_created_cb| |
26 // asynchronously. | 26 // asynchronously. |
27 virtual void Create( | 27 virtual void Create( |
28 const std::string& key_system, | 28 const std::string& key_system, |
29 bool allow_distinctive_identifier, | 29 bool allow_distinctive_identifier, |
30 bool allow_persistent_state, | 30 bool allow_persistent_state, |
31 const GURL& security_origin, | 31 const GURL& security_origin, |
32 const SessionMessageCB& session_message_cb, | 32 const SessionMessageCB& session_message_cb, |
33 const SessionClosedCB& session_closed_cb, | 33 const SessionClosedCB& session_closed_cb, |
34 const LegacySessionErrorCB& legacy_session_error_cb, | 34 const LegacySessionErrorCB& legacy_session_error_cb, |
35 const SessionKeysChangeCB& session_keys_change_cb, | 35 const SessionKeysChangeCB& session_keys_change_cb, |
36 const SessionExpirationUpdateCB& session_expiration_update_cb, | 36 const SessionExpirationUpdateCB& session_expiration_update_cb, |
37 const CdmCreatedCB& cdm_created_cb) = 0; | 37 const CdmCreatedCB& cdm_created_cb) = 0; |
38 | 38 |
39 private: | 39 private: |
40 DISALLOW_COPY_AND_ASSIGN(CdmFactory); | 40 DISALLOW_COPY_AND_ASSIGN(CdmFactory); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace media | 43 } // namespace media |
44 | 44 |
45 #endif // MEDIA_BASE_CDM_FACTORY_H_ | 45 #endif // MEDIA_BASE_CDM_FACTORY_H_ |
OLD | NEW |