| Index: media/mojo/services/mojo_cdm_service_context.h
|
| diff --git a/media/mojo/services/mojo_cdm_service_context.h b/media/mojo/services/mojo_cdm_service_context.h
|
| index dc55ad312c7b9d42e5f4523e27fd0c4255d7fddf..f3c2caf233164ff6e9962a43957768d55d1b3312 100644
|
| --- a/media/mojo/services/mojo_cdm_service_context.h
|
| +++ b/media/mojo/services/mojo_cdm_service_context.h
|
| @@ -5,20 +5,25 @@
|
| #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
|
| #define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_CONTEXT_H_
|
|
|
| -#include "base/containers/scoped_ptr_hash_map.h"
|
| +#include <map>
|
| +
|
| #include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "media/base/cdm_context.h"
|
| #include "media/base/media_export.h"
|
| -#include "media/mojo/services/mojo_cdm_service.h"
|
|
|
| namespace media {
|
|
|
| +class MojoCdmService;
|
| +
|
| // A class that creates, owns and manages all MojoCdmService instances.
|
| class MEDIA_EXPORT MojoCdmServiceContext : public CdmContextProvider {
|
| public:
|
| MojoCdmServiceContext();
|
| ~MojoCdmServiceContext() override;
|
|
|
| + base::WeakPtr<MojoCdmServiceContext> GetWeakPtr();
|
| +
|
| // Registers The |cdm_service| with |cdm_id|.
|
| void RegisterCdm(int cdm_id, MojoCdmService* cdm_service);
|
|
|
| @@ -36,6 +41,9 @@ class MEDIA_EXPORT MojoCdmServiceContext : public CdmContextProvider {
|
| // A map between CDM ID and MojoCdmService.
|
| std::map<int, MojoCdmService*> cdm_services_;
|
|
|
| + // NOTE: Weak pointers must be invalidated before all other member variables.
|
| + base::WeakPtrFactory<MojoCdmServiceContext> weak_ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MojoCdmServiceContext);
|
| };
|
|
|
|
|