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

Side by Side Diff: chrome/browser/media/android/cdm/media_drm_storage_impl.h

Issue 2765343003: media: Add MediaDrmStorage (Closed)
Patch Set: Created 3 years, 9 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 2016 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 CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_STORAGE_IMPL_H_
6 #define CHROME_BROWSER_MEDIA_ANDROID_CDM_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 chrome {
19
20 // Implements media::mojom::MediaDrmStorage to ........... ???
21 class MediaDrmStorageImpl : public media::mojom::MediaDrmStorage {
22 public:
23 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
24
25 static void Create(content::RenderFrameHost* render_frame_host,
26 media::mojom::MediaDrmStorageRequest request);
27
28 explicit MediaDrmStorageImpl(PrefService* pref_service);
29 ~MediaDrmStorageImpl() final;
30
31 // media::mojom::MediaDrmStorage implementation.
32 void Initialize(const url::Origin& origin) final;
33 void OnProvisioned(const OnProvisionedCallback& callback) final;
34 void SavePersistentSession(
35 const std::string& session_id,
36 const std::vector<uint8_t>& key_set_id,
37 const std::string& mime_type,
38 const SavePersistentSessionCallback& callback) final;
39 void LoadPersistentSession(
40 const std::string& session_id,
41 const LoadPersistentSessionCallback& callback) final;
42 void RemovePersistentSession(
43 const std::string& session_id,
44 const RemovePersistentSessionCallback& callback) final;
45
46 private:
47 PrefService* pref_service_;
48
49 // Store the origin in a string so it can be used as a key in the dictionary.
50 std::string origin_;
51
52 base::WeakPtrFactory<MediaDrmStorageImpl> weak_factory_;
53 };
54
55 } // namespace chrome
56
57 #endif // CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_STORAGE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698