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

Side by Side Diff: media/mojo/services/mojo_cdm_service.h

Issue 2411573002: media: Use new wrapper types for 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/mojo/services/mojo_cdm_promise.cc ('k') | media/mojo/services/mojo_cdm_service.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_SERVICES_MOJO_CDM_SERVICE_H_ 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 30 matching lines...) Expand all
41 static scoped_refptr<MediaKeys> LegacyGetCdm(int cdm_id); 41 static scoped_refptr<MediaKeys> LegacyGetCdm(int cdm_id);
42 42
43 // Constructs a MojoCdmService and strongly binds it to the |request|. 43 // Constructs a MojoCdmService and strongly binds it to the |request|.
44 MojoCdmService(base::WeakPtr<MojoCdmServiceContext> context, 44 MojoCdmService(base::WeakPtr<MojoCdmServiceContext> context,
45 CdmFactory* cdm_factory); 45 CdmFactory* cdm_factory);
46 46
47 ~MojoCdmService() final; 47 ~MojoCdmService() final;
48 48
49 // mojom::ContentDecryptionModule implementation. 49 // mojom::ContentDecryptionModule implementation.
50 void SetClient(mojom::ContentDecryptionModuleClientPtr client) final; 50 void SetClient(mojom::ContentDecryptionModuleClientPtr client) final;
51 void Initialize(const mojo::String& key_system, 51 void Initialize(const std::string& key_system,
52 const mojo::String& security_origin, 52 const std::string& security_origin,
53 mojom::CdmConfigPtr cdm_config, 53 mojom::CdmConfigPtr cdm_config,
54 const InitializeCallback& callback) final; 54 const InitializeCallback& callback) final;
55 void SetServerCertificate(mojo::Array<uint8_t> certificate_data, 55 void SetServerCertificate(const std::vector<uint8_t>& certificate_data,
56 const SetServerCertificateCallback& callback) final; 56 const SetServerCertificateCallback& callback) final;
57 void CreateSessionAndGenerateRequest( 57 void CreateSessionAndGenerateRequest(
58 mojom::ContentDecryptionModule::SessionType session_type, 58 mojom::ContentDecryptionModule::SessionType session_type,
59 mojom::ContentDecryptionModule::InitDataType init_data_type, 59 mojom::ContentDecryptionModule::InitDataType init_data_type,
60 mojo::Array<uint8_t> init_data, 60 const std::vector<uint8_t>& init_data,
61 const CreateSessionAndGenerateRequestCallback& callback) final; 61 const CreateSessionAndGenerateRequestCallback& callback) final;
62 void LoadSession(mojom::ContentDecryptionModule::SessionType session_type, 62 void LoadSession(mojom::ContentDecryptionModule::SessionType session_type,
63 const mojo::String& session_id, 63 const std::string& session_id,
64 const LoadSessionCallback& callback) final; 64 const LoadSessionCallback& callback) final;
65 void UpdateSession(const mojo::String& session_id, 65 void UpdateSession(const std::string& session_id,
66 mojo::Array<uint8_t> response, 66 const std::vector<uint8_t>& response,
67 const UpdateSessionCallback& callback) final; 67 const UpdateSessionCallback& callback) final;
68 void CloseSession(const mojo::String& session_id, 68 void CloseSession(const std::string& session_id,
69 const CloseSessionCallback& callback) final; 69 const CloseSessionCallback& callback) final;
70 void RemoveSession(const mojo::String& session_id, 70 void RemoveSession(const std::string& session_id,
71 const RemoveSessionCallback& callback) final; 71 const RemoveSessionCallback& callback) final;
72 72
73 // Get CDM to be used by the media pipeline. 73 // Get CDM to be used by the media pipeline.
74 scoped_refptr<MediaKeys> GetCdm(); 74 scoped_refptr<MediaKeys> GetCdm();
75 75
76 private: 76 private:
77 // Callback for CdmFactory::Create(). 77 // Callback for CdmFactory::Create().
78 void OnCdmCreated(const InitializeCallback& callback, 78 void OnCdmCreated(const InitializeCallback& callback,
79 const scoped_refptr<MediaKeys>& cdm, 79 const scoped_refptr<MediaKeys>& cdm,
80 const std::string& error_message); 80 const std::string& error_message);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 base::WeakPtr<MojoCdmService> weak_this_; 113 base::WeakPtr<MojoCdmService> weak_this_;
114 base::WeakPtrFactory<MojoCdmService> weak_factory_; 114 base::WeakPtrFactory<MojoCdmService> weak_factory_;
115 115
116 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); 116 DISALLOW_COPY_AND_ASSIGN(MojoCdmService);
117 }; 117 };
118 118
119 } // namespace media 119 } // namespace media
120 120
121 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ 121 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_promise.cc ('k') | media/mojo/services/mojo_cdm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698