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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/android/cdm/media_drm_storage_impl.h
diff --git a/chrome/browser/media/android/cdm/media_drm_storage_impl.h b/chrome/browser/media/android/cdm/media_drm_storage_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..0b2f31c03b3b60c251d5b0f9116592b3da965620
--- /dev/null
+++ b/chrome/browser/media/android/cdm/media_drm_storage_impl.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_STORAGE_IMPL_H_
+#define CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_STORAGE_IMPL_H_
+
+#include "content/public/browser/render_frame_host.h"
+#include "media/mojo/interfaces/media_drm_storage.mojom.h"
+#include "url/origin.h"
+
+class PrefService;
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+namespace chrome {
+
+// Implements media::mojom::MediaDrmStorage to ........... ???
+class MediaDrmStorageImpl : public media::mojom::MediaDrmStorage {
+ public:
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
+ static void Create(content::RenderFrameHost* render_frame_host,
+ media::mojom::MediaDrmStorageRequest request);
+
+ explicit MediaDrmStorageImpl(PrefService* pref_service);
+ ~MediaDrmStorageImpl() final;
+
+ // media::mojom::MediaDrmStorage implementation.
+ void Initialize(const url::Origin& origin) final;
+ void OnProvisioned(const OnProvisionedCallback& callback) final;
+ void SavePersistentSession(
+ const std::string& session_id,
+ const std::vector<uint8_t>& key_set_id,
+ const std::string& mime_type,
+ const SavePersistentSessionCallback& callback) final;
+ void LoadPersistentSession(
+ const std::string& session_id,
+ const LoadPersistentSessionCallback& callback) final;
+ void RemovePersistentSession(
+ const std::string& session_id,
+ const RemovePersistentSessionCallback& callback) final;
+
+ private:
+ PrefService* pref_service_;
+
+ // Store the origin in a string so it can be used as a key in the dictionary.
+ std::string origin_;
+
+ base::WeakPtrFactory<MediaDrmStorageImpl> weak_factory_;
+};
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_MEDIA_ANDROID_CDM_MEDIA_DRM_STORAGE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698