| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 ProxyMediaKeys::ProxyMediaKeys( | 203 ProxyMediaKeys::ProxyMediaKeys( |
| 204 RendererCdmManager* manager, | 204 RendererCdmManager* manager, |
| 205 const media::SessionMessageCB& session_message_cb, | 205 const media::SessionMessageCB& session_message_cb, |
| 206 const media::SessionReadyCB& session_ready_cb, | 206 const media::SessionReadyCB& session_ready_cb, |
| 207 const media::SessionClosedCB& session_closed_cb, | 207 const media::SessionClosedCB& session_closed_cb, |
| 208 const media::SessionErrorCB& session_error_cb) | 208 const media::SessionErrorCB& session_error_cb) |
| 209 : manager_(manager), | 209 : manager_(manager), |
| 210 session_message_cb_(session_message_cb), | 210 session_message_cb_(session_message_cb), |
| 211 session_ready_cb_(session_ready_cb), | 211 session_ready_cb_(session_ready_cb), |
| 212 session_closed_cb_(session_closed_cb), | 212 session_closed_cb_(session_closed_cb), |
| 213 session_error_cb_(session_error_cb) { | 213 session_error_cb_(session_error_cb), |
| 214 next_session_id_(1) { |
| 214 cdm_id_ = manager->RegisterMediaKeys(this); | 215 cdm_id_ = manager->RegisterMediaKeys(this); |
| 215 } | 216 } |
| 216 | 217 |
| 217 void ProxyMediaKeys::InitializeCdm(const std::string& key_system, | 218 void ProxyMediaKeys::InitializeCdm(const std::string& key_system, |
| 218 const GURL& security_origin) { | 219 const GURL& security_origin) { |
| 219 manager_->InitializeCdm(cdm_id_, this, key_system, security_origin); | 220 manager_->InitializeCdm(cdm_id_, this, key_system, security_origin); |
| 220 } | 221 } |
| 221 | 222 |
| 222 uint32_t ProxyMediaKeys::CreateSessionId() { | 223 uint32_t ProxyMediaKeys::CreateSessionId() { |
| 223 return next_session_id_++; | 224 return next_session_id_++; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 264 |
| 264 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) { | 265 scoped_ptr<media::CdmPromise> ProxyMediaKeys::TakePromise(uint32_t session_id) { |
| 265 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id); | 266 PromiseMap::iterator it = session_id_to_promise_map_.find(session_id); |
| 266 // May not be a promise associated with this session for asynchronous events. | 267 // May not be a promise associated with this session for asynchronous events. |
| 267 if (it == session_id_to_promise_map_.end()) | 268 if (it == session_id_to_promise_map_.end()) |
| 268 return scoped_ptr<media::CdmPromise>(); | 269 return scoped_ptr<media::CdmPromise>(); |
| 269 return session_id_to_promise_map_.take_and_erase(it); | 270 return session_id_to_promise_map_.take_and_erase(it); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace content | 273 } // namespace content |
| OLD | NEW |