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

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

Issue 835683002: media: Always define |cdm_id| in CdmContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 "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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 const std::string& web_session_id, 133 const std::string& web_session_id,
134 scoped_ptr<media::SimpleCdmPromise> promise) { 134 scoped_ptr<media::SimpleCdmPromise> promise) {
135 promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented."); 135 promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented.");
136 } 136 }
137 137
138 media::CdmContext* ProxyMediaKeys::GetCdmContext() { 138 media::CdmContext* ProxyMediaKeys::GetCdmContext() {
139 return this; 139 return this;
140 } 140 }
141 141
142 media::Decryptor* ProxyMediaKeys::GetDecryptor() { 142 media::Decryptor* ProxyMediaKeys::GetDecryptor() {
143 return NULL; 143 return nullptr;
144 } 144 }
145 145
146 int ProxyMediaKeys::GetCdmId() const { 146 int ProxyMediaKeys::GetCdmId() const {
147 return cdm_id_; 147 return cdm_id_;
148 } 148 }
149 149
150 void ProxyMediaKeys::OnSessionCreated(uint32 session_id, 150 void ProxyMediaKeys::OnSessionCreated(uint32 session_id,
151 const std::string& web_session_id) { 151 const std::string& web_session_id) {
152 AssignWebSessionId(session_id, web_session_id); 152 AssignWebSessionId(session_id, web_session_id);
153 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id); 153 scoped_ptr<media::CdmPromise> promise = TakePromise(session_id);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) { 282 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) {
283 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id); 283 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id);
284 // May not be a promise associated with this session for asynchronous events. 284 // May not be a promise associated with this session for asynchronous events.
285 if (it == session_id_to_promise_map_.end()) 285 if (it == session_id_to_promise_map_.end())
286 return scoped_ptr<media::CdmPromise>(); 286 return scoped_ptr<media::CdmPromise>();
287 return session_id_to_promise_map_.take_and_erase(it); 287 return session_id_to_promise_map_.take_and_erase(it);
288 } 288 }
289 289
290 } // namespace content 290 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698