Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: media/mojo/clients/mojo_cdm.h

Issue 2425663003: media: Use native CDM enum types in media mojo interfaces (Closed)
Patch Set: comments addressed Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/ipc/media_param_traits_macros.h ('k') | media/mojo/clients/mojo_cdm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MOJO_CLIENTS_MOJO_CDM_H_ 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_CDM_H_
6 #define MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ 6 #define MEDIA_MOJO_CLIENTS_MOJO_CDM_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 18 matching lines...) Expand all
29 29
30 class MojoDecryptor; 30 class MojoDecryptor;
31 31
32 // A MediaKeys that proxies to a mojom::ContentDecryptionModule. That 32 // A MediaKeys that proxies to a mojom::ContentDecryptionModule. That
33 // mojom::ContentDecryptionModule proxies back to the MojoCdm via the 33 // mojom::ContentDecryptionModule proxies back to the MojoCdm via the
34 // mojom::ContentDecryptionModuleClient interface. 34 // mojom::ContentDecryptionModuleClient interface.
35 class MojoCdm : public MediaKeys, 35 class MojoCdm : public MediaKeys,
36 public CdmContext, 36 public CdmContext,
37 public mojom::ContentDecryptionModuleClient { 37 public mojom::ContentDecryptionModuleClient {
38 public: 38 public:
39 using MessageType = MediaKeys::MessageType;
40
39 static void Create( 41 static void Create(
40 const std::string& key_system, 42 const std::string& key_system,
41 const GURL& security_origin, 43 const GURL& security_origin,
42 const media::CdmConfig& cdm_config, 44 const media::CdmConfig& cdm_config,
43 mojom::ContentDecryptionModulePtr remote_cdm, 45 mojom::ContentDecryptionModulePtr remote_cdm,
44 const media::SessionMessageCB& session_message_cb, 46 const media::SessionMessageCB& session_message_cb,
45 const media::SessionClosedCB& session_closed_cb, 47 const media::SessionClosedCB& session_closed_cb,
46 const media::SessionKeysChangeCB& session_keys_change_cb, 48 const media::SessionKeysChangeCB& session_keys_change_cb,
47 const media::SessionExpirationUpdateCB& session_expiration_update_cb, 49 const media::SessionExpirationUpdateCB& session_expiration_update_cb,
48 const media::CdmCreatedCB& cdm_created_cb); 50 const media::CdmCreatedCB& cdm_created_cb);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 85
84 void InitializeCdm(const std::string& key_system, 86 void InitializeCdm(const std::string& key_system,
85 const GURL& security_origin, 87 const GURL& security_origin,
86 const media::CdmConfig& cdm_config, 88 const media::CdmConfig& cdm_config,
87 std::unique_ptr<CdmInitializedPromise> promise); 89 std::unique_ptr<CdmInitializedPromise> promise);
88 90
89 void OnConnectionError(); 91 void OnConnectionError();
90 92
91 // mojom::ContentDecryptionModuleClient implementation. 93 // mojom::ContentDecryptionModuleClient implementation.
92 void OnSessionMessage(const std::string& session_id, 94 void OnSessionMessage(const std::string& session_id,
93 mojom::CdmMessageType message_type, 95 MessageType message_type,
94 const std::vector<uint8_t>& message) final; 96 const std::vector<uint8_t>& message) final;
95 void OnSessionClosed(const std::string& session_id) final; 97 void OnSessionClosed(const std::string& session_id) final;
96 void OnSessionKeysChange( 98 void OnSessionKeysChange(
97 const std::string& session_id, 99 const std::string& session_id,
98 bool has_additional_usable_key, 100 bool has_additional_usable_key,
99 std::vector<mojom::CdmKeyInformationPtr> keys_info) final; 101 std::vector<mojom::CdmKeyInformationPtr> keys_info) final;
100 void OnSessionExpirationUpdate(const std::string& session_id, 102 void OnSessionExpirationUpdate(const std::string& session_id,
101 double new_expiry_time_sec) final; 103 double new_expiry_time_sec) final;
102 104
103 // Callback for InitializeCdm. 105 // Callback for InitializeCdm.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 154
153 // This must be the last member. 155 // This must be the last member.
154 base::WeakPtrFactory<MojoCdm> weak_factory_; 156 base::WeakPtrFactory<MojoCdm> weak_factory_;
155 157
156 DISALLOW_COPY_AND_ASSIGN(MojoCdm); 158 DISALLOW_COPY_AND_ASSIGN(MojoCdm);
157 }; 159 };
158 160
159 } // namespace media 161 } // namespace media
160 162
161 #endif // MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ 163 #endif // MEDIA_MOJO_CLIENTS_MOJO_CDM_H_
OLDNEW
« no previous file with comments | « media/base/ipc/media_param_traits_macros.h ('k') | media/mojo/clients/mojo_cdm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698