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

Side by Side Diff: content/renderer/media/crypto/proxy_media_keys.cc

Issue 748473002: Introduce CdmContext interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@set_cdm
Patch Set: Created 6 years, 1 month 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 "content/renderer/media/crypto/proxy_media_keys.h" 5 #include "content/renderer/media/crypto/proxy_media_keys.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const std::string& web_session_id, 135 const std::string& web_session_id,
136 scoped_ptr<media::SimpleCdmPromise> promise) { 136 scoped_ptr<media::SimpleCdmPromise> promise) {
137 promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented."); 137 promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented.");
138 } 138 }
139 139
140 void ProxyMediaKeys::GetUsableKeyIds(const std::string& web_session_id, 140 void ProxyMediaKeys::GetUsableKeyIds(const std::string& web_session_id,
141 scoped_ptr<media::KeyIdsPromise> promise) { 141 scoped_ptr<media::KeyIdsPromise> promise) {
142 promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented."); 142 promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented.");
143 } 143 }
144 144
145 media::CdmContext* ProxyMediaKeys::GetCdmContext() {
146 return this;
147 }
148
149 media::Decryptor* ProxyMediaKeys::GetDecryptor() {
150 return NULL;
151 }
152
145 int ProxyMediaKeys::GetCdmId() const { 153 int ProxyMediaKeys::GetCdmId() const {
146 return cdm_id_; 154 return cdm_id_;
147 } 155 }
148 156
149 void ProxyMediaKeys::OnSessionCreated(uint32 session_id, 157 void ProxyMediaKeys::OnSessionCreated(uint32 session_id,
150 const std::string& web_session_id) { 158 const std::string& web_session_id) {
151 AssignWebSessionId(session_id, web_session_id); 159 AssignWebSessionId(session_id, web_session_id);
152 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id); 160 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id);
153 if (promise) { 161 if (promise) {
154 media::NewSessionCdmPromise* session_promise( 162 media::NewSessionCdmPromise* session_promise(
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 294
287 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) { 295 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) {
288 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id); 296 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id);
289 // May not be a promise associated with this session for asynchronous events. 297 // May not be a promise associated with this session for asynchronous events.
290 if (it == session_id_to_promise_map_.end()) 298 if (it == session_id_to_promise_map_.end())
291 return scoped_ptr<media::CdmPromise>(); 299 return scoped_ptr<media::CdmPromise>();
292 return session_id_to_promise_map_.take_and_erase(it); 300 return session_id_to_promise_map_.take_and_erase(it);
293 } 301 }
294 302
295 } // namespace content 303 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698