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 MEDIA_MOJO_SERVICES_MOJO_MEDIA_DRM_STORAGE_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MOJO_MEDIA_DRM_STORAGE_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "media/base/android/media_drm_storage.h" |
| 12 #include "media/mojo/interfaces/media_drm_storage.mojom.h" |
| 13 #include "media/mojo/services/media_mojo_export.h" |
| 14 |
| 15 namespace media { |
| 16 |
| 17 // A MediaDrmStorage that proxies to a mojom::MediaDrmStoragePtr. |
| 18 class MEDIA_MOJO_EXPORT MojoMediaDrmStorage |
| 19 : NON_EXPORTED_BASE(public MediaDrmStorage) { |
| 20 public: |
| 21 explicit MojoMediaDrmStorage(mojom::MediaDrmStoragePtr media_drm_storage_ptr); |
| 22 ~MojoMediaDrmStorage() final; |
| 23 |
| 24 // MediaDrmStorage implementation: |
| 25 void Initialize(const url::Origin& origin) final; |
| 26 void OnProvisioned(ResultCB result_cb) final; |
| 27 void SavePersistentSession(const std::string& session_id, |
| 28 const SessionData& session_data, |
| 29 ResultCB result_cb) final; |
| 30 void LoadPersistentSession( |
| 31 const std::string& session_id, |
| 32 LoadPersistentSessionCB load_persistent_session_cb) final; |
| 33 void RemovePersistentSession(const std::string& session_id, |
| 34 ResultCB result_cb) final; |
| 35 |
| 36 private: |
| 37 void OnResult(ResultCB result_cb, bool success); |
| 38 void OnPersistentSessionLoaded( |
| 39 LoadPersistentSessionCB load_persistent_session_cb, |
| 40 mojom::SessionDataPtr session_data); |
| 41 |
| 42 mojom::MediaDrmStoragePtr media_drm_storage_ptr_; |
| 43 base::WeakPtrFactory<MojoMediaDrmStorage> weak_factory_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(MojoMediaDrmStorage); |
| 46 }; |
| 47 |
| 48 } // namespace media |
| 49 |
| 50 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_DRM_STORAGE_H_ |
OLD | NEW |