OLD | NEW |
---|---|
(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| | |
ddorwin
2015/05/15 19:10:07
"for" doesn't really apply to the last two paramet
xhwang
2015/06/01 21:21:25
Done.
| |
23 // and |cdm_id|. The returned MojoCdmService is owned by |this|. Returns | |
24 // nullptr if no MojoCdmService can be created. | |
25 MojoCdmService* Create(const mojo::String& key_system, | |
26 const mojo::String& security_origin, | |
27 int32_t cdm_id); | |
28 | |
29 // CdmContextProvider implementation. | |
30 CdmContext* GetCdmContext(int32_t cdm_id) override; | |
ddorwin
2015/05/15 19:10:07
Why wouldn't a caller just get the context from th
xhwang
2015/06/01 21:21:25
The caller (MojoRendererService) needs to find the
| |
31 | |
32 // Called when there is a connection error with |service|. | |
33 void ServiceHadConnectionError(MojoCdmService* service); | |
34 | |
35 private: | |
36 // A map between CDM IDs and MojoCdnServices, which owns all MojoCdmServices | |
ddorwin
2015/05/15 19:10:07
typo: "Cdn"
grammar: ", which" refers to MojoCdnS
xhwang
2015/06/01 21:21:25
Done.
| |
37 // created. | |
38 base::ScopedPtrHashMap<int32_t, MojoCdmService> services_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(MojoCdmServiceContext); | |
41 }; | |
42 | |
43 } // namespace media | |
44 | |
45 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_ | |
OLD | NEW |