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

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

Issue 2070753002: media: Add unittest for MojoRenderer{Impl|Service} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "media/base/media_keys.h" 16 #include "media/base/media_keys.h"
17 #include "media/mojo/interfaces/content_decryption_module.mojom.h" 17 #include "media/mojo/interfaces/content_decryption_module.mojom.h"
18 #include "media/mojo/services/media_mojo_export.h" 18 #include "media/mojo/services/media_mojo_export.h"
19 #include "media/mojo/services/mojo_cdm_promise.h" 19 #include "media/mojo/services/mojo_cdm_promise.h"
20 #include "media/mojo/services/mojo_cdm_service_context.h" 20 #include "media/mojo/services/mojo_cdm_service_context.h"
21 #include "media/mojo/services/mojo_decryptor_service.h" 21 #include "media/mojo/services/mojo_decryptor_service.h"
22 #include "mojo/public/cpp/bindings/strong_binding.h" 22 #include "mojo/public/cpp/bindings/strong_binding.h"
23 23
24 namespace media { 24 namespace media {
25 25
26 class CdmFactory; 26 class CdmFactory;
27 27
28 // A mojom::ContentDecryptionModule implementation backed by a 28 // A mojom::ContentDecryptionModule implementation backed by a
29 // media::MediaKeys. 29 // media::MediaKeys.
30 class MojoCdmService : public mojom::ContentDecryptionModule { 30 class MEDIA_MOJO_EXPORT MojoCdmService : public mojom::ContentDecryptionModule {
31 public: 31 public:
32 // Get the CDM associated with |cdm_id|, which is unique per process. 32 // Get the CDM associated with |cdm_id|, which is unique per process.
33 // Can be called on any thread. The returned CDM is not guaranteed to be 33 // Can be called on any thread. The returned CDM is not guaranteed to be
34 // thread safe. 34 // thread safe.
35 // Note: This provides a generic hack to get the CDM in the process where 35 // Note: This provides a generic hack to get the CDM in the process where
36 // MojoMediaApplication is running, regardless of which render process or 36 // MojoMediaApplication is running, regardless of which render process or
37 // render frame the caller is associated with. In the future, we should move 37 // render frame the caller is associated with. In the future, we should move
38 // all out-of-process media players into the MojoMediaApplicaiton so that we 38 // all out-of-process media players into the MojoMediaApplicaiton so that we
39 // can use MojoCdmServiceContext (per render frame) to get the CDM. 39 // can use MojoCdmServiceContext (per render frame) to get the CDM.
40 static scoped_refptr<MediaKeys> MEDIA_MOJO_EXPORT LegacyGetCdm(int cdm_id); 40 static scoped_refptr<MediaKeys> LegacyGetCdm(int cdm_id);
41 41
42 // Constructs a MojoCdmService and strongly binds it to the |request|. 42 // Constructs a MojoCdmService and strongly binds it to the |request|.
43 MojoCdmService( 43 MojoCdmService(
44 base::WeakPtr<MojoCdmServiceContext> context, 44 base::WeakPtr<MojoCdmServiceContext> context,
45 CdmFactory* cdm_factory, 45 CdmFactory* cdm_factory,
46 mojo::InterfaceRequest<mojom::ContentDecryptionModule> request); 46 mojo::InterfaceRequest<mojom::ContentDecryptionModule> request);
47 47
48 ~MojoCdmService() final; 48 ~MojoCdmService() final;
49 49
50 // mojom::ContentDecryptionModule implementation. 50 // mojom::ContentDecryptionModule implementation.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 base::WeakPtr<MojoCdmService> weak_this_; 126 base::WeakPtr<MojoCdmService> weak_this_;
127 base::WeakPtrFactory<MojoCdmService> weak_factory_; 127 base::WeakPtrFactory<MojoCdmService> weak_factory_;
128 128
129 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); 129 DISALLOW_COPY_AND_ASSIGN(MojoCdmService);
130 }; 130 };
131 131
132 } // namespace media 132 } // namespace media
133 133
134 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ 134 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698