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

Side by Side Diff: media/mojo/services/mojo_media_drm_storage.cc

Issue 2765343003: media: Add MediaDrmStorage (Closed)
Patch Set: Move MediaDrmStorageImpl to components/ 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 unified diff | Download patch
OLDNEW
(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
OLDNEW
« media/mojo/interfaces/media_drm_storage.mojom ('K') | « media/mojo/services/mojo_media_drm_storage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698