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

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

Issue 1004623009: media: Hook up ContentDecryptionModuleClient in mojo CDM service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "media/base/media_keys.h" 12 #include "media/base/media_keys.h"
13 #include "media/mojo/interfaces/content_decryption_module.mojom.h" 13 #include "media/mojo/interfaces/content_decryption_module.mojom.h"
14 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" 14 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h"
15 15
16 namespace media { 16 namespace media {
17 17
18 // A mojo::ContentDecryptionModule implementation backed by a media::MediaKeys. 18 // A mojo::ContentDecryptionModule implementation backed by a media::MediaKeys.
19 class MojoCdmService 19 class MojoCdmService
20 : public mojo::InterfaceImpl<mojo::ContentDecryptionModule> { 20 : public mojo::InterfaceImpl<mojo::ContentDecryptionModule> {
21 public: 21 public:
22 MojoCdmService(const mojo::String& key_system); 22 MojoCdmService(const mojo::String& key_system);
23 ~MojoCdmService() final; 23 ~MojoCdmService() final;
24 24
25 // mojo::ContentDecryptionModule implementation. 25 // mojo::ContentDecryptionModule implementation.
26 void SetClient(mojo::ContentDecryptionModuleClientPtr client) final;
26 void SetServerCertificate( 27 void SetServerCertificate(
27 mojo::Array<uint8_t> certificate_data, 28 mojo::Array<uint8_t> certificate_data,
28 const mojo::Callback<void(mojo::CdmPromiseResultPtr)>& callback) final; 29 const mojo::Callback<void(mojo::CdmPromiseResultPtr)>& callback) final;
29 void CreateSessionAndGenerateRequest( 30 void CreateSessionAndGenerateRequest(
30 mojo::ContentDecryptionModule::SessionType session_type, 31 mojo::ContentDecryptionModule::SessionType session_type,
31 const mojo::String& init_data_type, 32 const mojo::String& init_data_type,
32 mojo::Array<uint8_t> init_data, 33 mojo::Array<uint8_t> init_data,
33 const mojo::Callback<void(mojo::CdmPromiseResultPtr, mojo::String)>& 34 const mojo::Callback<void(mojo::CdmPromiseResultPtr, mojo::String)>&
34 callback) final; 35 callback) final;
35 void LoadSession(mojo::ContentDecryptionModule::SessionType session_type, 36 void LoadSession(mojo::ContentDecryptionModule::SessionType session_type,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 73
73 base::WeakPtr<MojoCdmService> weak_this_; 74 base::WeakPtr<MojoCdmService> weak_this_;
74 base::WeakPtrFactory<MojoCdmService> weak_factory_; 75 base::WeakPtrFactory<MojoCdmService> weak_factory_;
75 76
76 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); 77 DISALLOW_COPY_AND_ASSIGN(MojoCdmService);
77 }; 78 };
78 79
79 } // namespace media 80 } // namespace media
80 81
81 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ 82 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698