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

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

Issue 840473002: media: Support creation and SetCdm() for mojo based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only; compiles but needs more polish... Created 5 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
7
8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/macros.h"
10 #include "media/base/cdm_context.h"
11 #include "media/base/media_export.h"
12 #include "media/mojo/services/mojo_cdm_service.h"
13
14 namespace media {
15
16 // A class that creates, owns and manages all MojoCdmService instances.
17 class MEDIA_EXPORT MojoCdmServiceContext : public CdmContextProvider {
18 public:
19 MojoCdmServiceContext();
20 ~MojoCdmServiceContext() override;
21
22 // Creates and returns a MojoCdmService for |key_system|, |security_origin|
23 // and |cdm_id|. The returned MojoCdmService is owned by |this|. Returns
24 // nullptr if no MojoCdmService can be created.
25 MojoCdmService* Create(
26 const mojo::String& key_system,
27 const mojo::String& security_origin,
28 int32_t cdm_id,
29 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request);
30
31 // CdmContextProvider implementation.
32 CdmContext* GetCdmContext(int32_t cdm_id) override;
33
34 // Called when there is a connection error with |service|.
35 void ServiceHadConnectionError(MojoCdmService* service);
36
37 private:
38 // A map between CDM IDs and MojoCdnServices, which owns all MojoCdmServices
39 // created.
40 base::ScopedPtrHashMap<int32_t, scoped_ptr<MojoCdmService>> services_;
41
42 DISALLOW_COPY_AND_ASSIGN(MojoCdmServiceContext);
43 };
44
45 } // namespace media
46
47 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_service.cc ('k') | media/mojo/services/mojo_cdm_service_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698