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 #include "media/mojo/services/mojo_media_drm_storage.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
| 9 |
| 10 namespace media { |
| 11 |
| 12 MojoMediaDrmStorage::MojoMediaDrmStorage( |
| 13 mojom::MediaDrmStoragePtr media_drm_storage_ptr) |
| 14 : media_drm_storage_ptr_(std::move(media_drm_storage_ptr)), |
| 15 weak_factory_(this) { |
| 16 DVLOG(1) << __func__; |
| 17 } |
| 18 |
| 19 MojoMediaDrmStorage::~MojoMediaDrmStorage() {} |
| 20 |
| 21 void MojoMediaDrmStorage::Initialize(const url::Origin& origin) { |
| 22 DVLOG(1) << __func__; |
| 23 media_drm_storage_ptr_->Initialize(origin); |
| 24 } |
| 25 |
| 26 void MojoMediaDrmStorage::OnProvisioned(ResultCB result_cb) { |
| 27 DVLOG(1) << __func__; |
| 28 media_drm_storage_ptr_->OnProvisioned( |
| 29 base::Bind(&MojoMediaDrmStorage::OnResult, weak_factory_.GetWeakPtr(), |
| 30 base::Passed(&result_cb))); |
| 31 } |
| 32 |
| 33 void MojoMediaDrmStorage::SavePersistentSession( |
| 34 const std::string& session_id, |
| 35 const std::vector<uint8_t>& key_set_id, |
| 36 const std::string& mime_type, |
| 37 ResultCB result_cb) { |
| 38 DVLOG(1) << __func__; |
| 39 media_drm_storage_ptr_->SavePersistentSession( |
| 40 session_id, key_set_id, mime_type, |
| 41 base::Bind(&MojoMediaDrmStorage::OnResult, weak_factory_.GetWeakPtr(), |
| 42 base::Passed(&result_cb))); |
| 43 } |
| 44 |
| 45 void MojoMediaDrmStorage::LoadPersistentSession( |
| 46 const std::string& session_id, |
| 47 LoadPersistentSessionCB load_persistent_session_cb) { |
| 48 DVLOG(1) << __func__; |
| 49 } |
| 50 |
| 51 void MojoMediaDrmStorage::RemovePersistentSession(const std::string& session_id, |
| 52 ResultCB result_cb) { |
| 53 DVLOG(1) << __func__; |
| 54 } |
| 55 |
| 56 void MojoMediaDrmStorage::OnResult(ResultCB result_cb, bool success) { |
| 57 DVLOG(1) << __func__; |
| 58 std::move(result_cb).Run(success); |
| 59 } |
| 60 |
| 61 } // namespace media |
OLD | NEW |