| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_DRM_STORAGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_DRM_STORAGE_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_STORAGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_STORAGE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" |
| 16 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
| 17 #include "url/origin.h" | 18 #include "url/origin.h" |
| 18 | 19 |
| 19 namespace media { | 20 namespace media { |
| 20 | 21 |
| 21 // Allows MediaDrmBridge to store and retrieve persistent data. This is needed | 22 // Allows MediaDrmBridge to store and retrieve persistent data. This is needed |
| 22 // for features like per-origin provisioning and persistent license support. | 23 // for features like per-origin provisioning and persistent license support. |
| 23 class MEDIA_EXPORT MediaDrmStorage { | 24 class MEDIA_EXPORT MediaDrmStorage |
| 25 : public base::SupportsWeakPtr<MediaDrmStorage> { |
| 24 public: | 26 public: |
| 25 struct SessionData { | 27 struct SessionData { |
| 26 SessionData(std::vector<uint8_t> key_set_id, std::string mime_type); | 28 SessionData(std::vector<uint8_t> key_set_id, std::string mime_type); |
| 29 SessionData(const SessionData& other); |
| 27 ~SessionData(); | 30 ~SessionData(); |
| 28 | 31 |
| 29 std::vector<uint8_t> key_set_id; | 32 std::vector<uint8_t> key_set_id; |
| 30 std::string mime_type; | 33 std::string mime_type; |
| 31 }; | 34 }; |
| 32 | 35 |
| 33 MediaDrmStorage(); | 36 MediaDrmStorage(); |
| 34 virtual ~MediaDrmStorage(); | 37 virtual ~MediaDrmStorage(); |
| 35 | 38 |
| 36 // Callback to return whether the operation succeeded. | 39 // Callback to return whether the operation succeeded. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 80 |
| 78 private: | 81 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(MediaDrmStorage); | 82 DISALLOW_COPY_AND_ASSIGN(MediaDrmStorage); |
| 80 }; | 83 }; |
| 81 | 84 |
| 82 using CreateStorageCB = base::Callback<std::unique_ptr<MediaDrmStorage>()>; | 85 using CreateStorageCB = base::Callback<std::unique_ptr<MediaDrmStorage>()>; |
| 83 | 86 |
| 84 } // namespace media | 87 } // namespace media |
| 85 | 88 |
| 86 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_STORAGE_H_ | 89 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_STORAGE_H_ |
| OLD | NEW |