OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 COMPONENTS_CDM_BROWSER_MEDIA_DRM_STORAGE_IMPL_H_ | |
6 #define COMPONENTS_CDM_BROWSER_MEDIA_DRM_STORAGE_IMPL_H_ | |
7 | |
8 #include "content/public/browser/render_frame_host.h" | |
9 #include "media/mojo/interfaces/media_drm_storage.mojom.h" | |
10 #include "url/origin.h" | |
11 | |
12 class PrefService; | |
13 | |
14 namespace user_prefs { | |
15 class PrefRegistrySyncable; | |
16 } | |
17 | |
18 namespace cdm { | |
19 | |
20 // Implements media::mojom::MediaDrmStorage using PrefService. | |
21 // This file is located under components/ so that it can be shared by multiple | |
22 // content embedders (e.g. chrome and chromecast). | |
23 class MediaDrmStorageImpl : public media::mojom::MediaDrmStorage { | |
24 public: | |
25 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | |
26 | |
27 explicit MediaDrmStorageImpl(PrefService* pref_service); | |
28 ~MediaDrmStorageImpl() final; | |
dcheng
2017/03/29 01:17:23
Alternatively, the entire class can be marked fina
xhwang
2017/03/29 20:47:25
Done.
But then do I still need to mark each overr
| |
29 | |
30 // media::mojom::MediaDrmStorage implementation. | |
31 void Initialize(const url::Origin& origin) final; | |
32 void OnProvisioned(const OnProvisionedCallback& callback) final; | |
33 void SavePersistentSession( | |
34 const std::string& session_id, | |
35 const std::vector<uint8_t>& key_set_id, | |
36 const std::string& mime_type, | |
37 const SavePersistentSessionCallback& callback) final; | |
38 void LoadPersistentSession( | |
39 const std::string& session_id, | |
40 const LoadPersistentSessionCallback& callback) final; | |
41 void RemovePersistentSession( | |
42 const std::string& session_id, | |
43 const RemovePersistentSessionCallback& callback) final; | |
44 | |
45 private: | |
46 PrefService* pref_service_; | |
47 | |
48 // Store the origin in a string so it can be used as a key in the dictionary. | |
49 std::string origin_; | |
50 | |
51 base::WeakPtrFactory<MediaDrmStorageImpl> weak_factory_; | |
52 }; | |
53 | |
54 } // namespace cdm | |
55 | |
56 #endif // COMPONENTS_CDM_BROWSER_MEDIA_DRM_STORAGE_IMPL_H_ | |
OLD | NEW |