OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |