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

Unified Diff: media/mojo/services/mojo_media_drm_storage.h

Issue 2765343003: media: Add MediaDrmStorage (Closed)
Patch Set: rebase only 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
« no previous file with comments | « media/mojo/services/gpu_mojo_media_client.cc ('k') | media/mojo/services/mojo_media_drm_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_media_drm_storage.h
diff --git a/media/mojo/services/mojo_media_drm_storage.h b/media/mojo/services/mojo_media_drm_storage.h
new file mode 100644
index 0000000000000000000000000000000000000000..07d79e378659d1498c07893dea14b831e7d92d95
--- /dev/null
+++ b/media/mojo/services/mojo_media_drm_storage.h
@@ -0,0 +1,50 @@
+// Copyright 2017 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 MEDIA_MOJO_SERVICES_MOJO_MEDIA_DRM_STORAGE_H_
+#define MEDIA_MOJO_SERVICES_MOJO_MEDIA_DRM_STORAGE_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "media/base/android/media_drm_storage.h"
+#include "media/mojo/interfaces/media_drm_storage.mojom.h"
+#include "media/mojo/services/media_mojo_export.h"
+
+namespace media {
+
+// A MediaDrmStorage that proxies to a mojom::MediaDrmStoragePtr.
+class MEDIA_MOJO_EXPORT MojoMediaDrmStorage
+ : NON_EXPORTED_BASE(public MediaDrmStorage) {
+ public:
+ explicit MojoMediaDrmStorage(mojom::MediaDrmStoragePtr media_drm_storage_ptr);
+ ~MojoMediaDrmStorage() final;
+
+ // MediaDrmStorage implementation:
+ void Initialize(const url::Origin& origin) final;
+ void OnProvisioned(ResultCB result_cb) final;
+ void SavePersistentSession(const std::string& session_id,
+ const SessionData& session_data,
+ ResultCB result_cb) final;
+ void LoadPersistentSession(
+ const std::string& session_id,
+ LoadPersistentSessionCB load_persistent_session_cb) final;
+ void RemovePersistentSession(const std::string& session_id,
+ ResultCB result_cb) final;
+
+ private:
+ void OnResult(ResultCB result_cb, bool success);
+ void OnPersistentSessionLoaded(
+ LoadPersistentSessionCB load_persistent_session_cb,
+ mojom::SessionDataPtr session_data);
+
+ mojom::MediaDrmStoragePtr media_drm_storage_ptr_;
+ base::WeakPtrFactory<MojoMediaDrmStorage> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoMediaDrmStorage);
+};
+
+} // namespace media
+
+#endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_DRM_STORAGE_H_
« no previous file with comments | « media/mojo/services/gpu_mojo_media_client.cc ('k') | media/mojo/services/mojo_media_drm_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698