Chromium Code Reviews| Index: media/base/android/media_drm_storage_bridge.h |
| diff --git a/media/base/android/media_drm_storage_bridge.h b/media/base/android/media_drm_storage_bridge.h |
| index 955e570126c98a95db1b0532ea19b51e7f38e618..f0c57c35ddbd3e7c7d2402e612e401ea9c0a5cdd 100644 |
| --- a/media/base/android/media_drm_storage_bridge.h |
| +++ b/media/base/android/media_drm_storage_bridge.h |
| @@ -29,10 +29,18 @@ class MediaDrmStorageBridge { |
| public: |
| static bool RegisterMediaDrmStorageBridge(JNIEnv* env); |
| - MediaDrmStorageBridge(const url::Origin& origin, |
| - const CreateStorageCB& create_storage_cb); |
| + MediaDrmStorageBridge(); |
| ~MediaDrmStorageBridge(); |
| + // Bind origin to |this|. Once storage is initialized, |on_init| will be |
| + // called and it will have a random generated origin id for later usage. If |
| + // this function isn't called, all the other functions will fail. |
|
xhwang
2017/07/21 18:18:26
"This function must be called before any other fun
yucliu1
2017/07/21 20:24:09
Already DCHECK(impl_) which is assigned in Initial
|
| + void Initialize(const url::Origin& origin, |
| + const CreateStorageCB& create_storage_cb, |
| + base::OnceClosure on_init); |
|
xhwang
2017/07/21 18:18:27
nit: s/on_init/init_cb
yucliu1
2017/07/21 20:24:09
Done.
|
| + |
| + std::string origin_id() const { return origin_id_; } |
| + |
| // The following OnXXX functions are called by Java. The functions will post |
| // task on message loop immediately to avoid reentrancy issues. |
| @@ -73,12 +81,10 @@ class MediaDrmStorageBridge { |
| const std::string& session_id, |
| std::unique_ptr<MediaDrmStorage::SessionData> session_data); |
| - MediaDrmStorage* GetStorageImpl(); |
| - |
| - CreateStorageCB create_storage_cb_; |
| std::unique_ptr<MediaDrmStorage> impl_; |
| - const url::Origin origin_; |
| + // Random generated ID for origin. |
|
xhwang
2017/07/21 18:18:26
nit: Randomly
yucliu1
2017/07/21 20:24:09
Done.
|
| + std::string origin_id_; |
| scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |