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

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

Issue 1227883002: media: Pass CdmConfig in mojo CDM interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase-only Created 5 years, 5 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "media/mojo/services/mojo_cdm.h" 5 #include "media/mojo/services/mojo_cdm.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "media/base/cdm_context.h" 9 #include "media/base/cdm_context.h"
10 #include "media/base/cdm_key_information.h" 10 #include "media/base/cdm_key_information.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 binding_.Bind(GetProxy(&client_ptr)); 80 binding_.Bind(GetProxy(&client_ptr));
81 remote_cdm_->SetClient(client_ptr.Pass()); 81 remote_cdm_->SetClient(client_ptr.Pass());
82 } 82 }
83 83
84 MojoCdm::~MojoCdm() { 84 MojoCdm::~MojoCdm() {
85 DVLOG(1) << __FUNCTION__; 85 DVLOG(1) << __FUNCTION__;
86 } 86 }
87 87
88 void MojoCdm::InitializeCdm(const std::string& key_system, 88 void MojoCdm::InitializeCdm(const std::string& key_system,
89 const GURL& security_origin, 89 const GURL& security_origin,
90 const media::CdmConfig& /* cdm_config */, 90 const media::CdmConfig& cdm_config,
91 scoped_ptr<CdmInitializedPromise> promise) { 91 scoped_ptr<CdmInitializedPromise> promise) {
92 DVLOG(1) << __FUNCTION__ << ": " << key_system; 92 DVLOG(1) << __FUNCTION__ << ": " << key_system;
93 // TODO(xhwang): Pass |cdm_config| down.
94 remote_cdm_->Initialize( 93 remote_cdm_->Initialize(
95 key_system, security_origin.spec(), cdm_id_, 94 key_system, security_origin.spec(), mojo::CdmConfig::From(cdm_config),
96 base::Bind(&MojoCdm::OnPromiseResult<>, weak_factory_.GetWeakPtr(), 95 cdm_id_, base::Bind(&MojoCdm::OnPromiseResult<>,
97 base::Passed(&promise))); 96 weak_factory_.GetWeakPtr(), base::Passed(&promise)));
98 } 97 }
99 98
100 void MojoCdm::SetServerCertificate(const std::vector<uint8_t>& certificate, 99 void MojoCdm::SetServerCertificate(const std::vector<uint8_t>& certificate,
101 scoped_ptr<SimpleCdmPromise> promise) { 100 scoped_ptr<SimpleCdmPromise> promise) {
102 DVLOG(2) << __FUNCTION__; 101 DVLOG(2) << __FUNCTION__;
103 remote_cdm_->SetServerCertificate( 102 remote_cdm_->SetServerCertificate(
104 mojo::Array<uint8_t>::From(certificate), 103 mojo::Array<uint8_t>::From(certificate),
105 base::Bind(&MojoCdm::OnPromiseResult<>, weak_factory_.GetWeakPtr(), 104 base::Bind(&MojoCdm::OnPromiseResult<>, weak_factory_.GetWeakPtr(),
106 base::Passed(&promise))); 105 base::Passed(&promise)));
107 } 106 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 219 }
221 220
222 void MojoCdm::OnSessionExpirationUpdate(const mojo::String& session_id, 221 void MojoCdm::OnSessionExpirationUpdate(const mojo::String& session_id,
223 double new_expiry_time_sec) { 222 double new_expiry_time_sec) {
224 DVLOG(2) << __FUNCTION__; 223 DVLOG(2) << __FUNCTION__;
225 session_expiration_update_cb_.Run( 224 session_expiration_update_cb_.Run(
226 session_id, base::Time::FromDoubleT(new_expiry_time_sec)); 225 session_id, base::Time::FromDoubleT(new_expiry_time_sec));
227 } 226 }
228 227
229 } // namespace media 228 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/media_type_converters_unittest.cc ('k') | media/mojo/services/mojo_cdm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698