Chromium Code Reviews| Index: media/cdm/cdm_adapter.h |
| diff --git a/media/cdm/cdm_adapter.h b/media/cdm/cdm_adapter.h |
| index cb08f4a155d62ad63d7e75579be789c323f4e77d..392f5c3183e8eb6739b514c15a7bb27d7e6838f7 100644 |
| --- a/media/cdm/cdm_adapter.h |
| +++ b/media/cdm/cdm_adapter.h |
| @@ -7,9 +7,11 @@ |
| #include <stdint.h> |
| +#include <memory> |
| #include <string> |
| #include <vector> |
| +#include "base/callback.h" |
| #include "base/compiler_specific.h" |
| #include "base/files/file_path.h" |
| #include "base/macros.h" |
| @@ -32,8 +34,17 @@ namespace media { |
| class AudioFramesImpl; |
| class CdmAllocator; |
| +class CdmFileIO; |
| class CdmWrapper; |
| +// Called when the CDM needs a FileIO object from the host to do file IO |
| +// operations. Returns NULL if a FileIO object cannot be obtained. Once a |
| +// valid FileIO object is returned, |client| must be valid until |
| +// FileIO::Close() is called. The CDM can call this method multiple times |
| +// to operate on different files. |
| +using CdmFileIOProviderCB = |
|
xhwang
2016/04/18 21:09:22
The naming is a bit odd since the callback does cr
jrummell
2016/04/19 23:59:29
Done.
|
| + base::Callback<std::unique_ptr<CdmFileIO>(cdm::FileIOClient* client)>; |
| + |
| class MEDIA_EXPORT CdmAdapter : public MediaKeys, |
| public CdmContext, |
| public Decryptor, |
| @@ -42,14 +53,16 @@ class MEDIA_EXPORT CdmAdapter : public MediaKeys, |
| public: |
| // Create the CDM using |cdm_path| and initialize it using |key_system| and |
| // |cdm_config|. |allocator| is to be used whenever the CDM needs memory |
| - // and to create VideoFrames. Callbacks will be used for events generated |
| - // by the CDM. |cdm_created_cb| will be called when the CDM is loaded and |
| - // initialized. |
| + // and to create VideoFrames. |file_io_provider| is to be used whenever the |
| + // CDM needs access to the file system. Callbacks will be used for events |
| + // generated by the CDM. |cdm_created_cb| will be called when the CDM is |
| + // loaded and initialized. |
| static void Create( |
| const std::string& key_system, |
| const base::FilePath& cdm_path, |
| const CdmConfig& cdm_config, |
| scoped_ptr<CdmAllocator> allocator, |
| + const CdmFileIOProviderCB& file_io_provider_cb, |
| const SessionMessageCB& session_message_cb, |
| const SessionClosedCB& session_closed_cb, |
| const LegacySessionErrorCB& legacy_session_error_cb, |
| @@ -149,6 +162,7 @@ class MEDIA_EXPORT CdmAdapter : public MediaKeys, |
| CdmAdapter(const std::string& key_system, |
| const CdmConfig& cdm_config, |
| scoped_ptr<CdmAllocator> allocator, |
| + const CdmFileIOProviderCB& file_io_provider_cb, |
| const SessionMessageCB& session_message_cb, |
| const SessionClosedCB& session_closed_cb, |
| const LegacySessionErrorCB& legacy_session_error_cb, |
| @@ -210,6 +224,7 @@ class MEDIA_EXPORT CdmAdapter : public MediaKeys, |
| ChannelLayout audio_channel_layout_; |
| scoped_ptr<CdmAllocator> allocator_; |
| + CdmFileIOProviderCB file_io_provider_cb_; |
| scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |