Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cdm/proxy_decryptor.h" | 5 #include "media/cdm/proxy_decryptor.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 media_keys_->RemoveSession(session_id, promise.Pass()); | 191 media_keys_->RemoveSession(session_id, promise.Pass()); |
| 192 } | 192 } |
| 193 | 193 |
| 194 scoped_ptr<MediaKeys> ProxyDecryptor::CreateMediaKeys( | 194 scoped_ptr<MediaKeys> ProxyDecryptor::CreateMediaKeys( |
| 195 CdmFactory* cdm_factory, | 195 CdmFactory* cdm_factory, |
| 196 const std::string& key_system, | 196 const std::string& key_system, |
| 197 const GURL& security_origin) { | 197 const GURL& security_origin) { |
| 198 base::WeakPtr<ProxyDecryptor> weak_this = weak_ptr_factory_.GetWeakPtr(); | 198 base::WeakPtr<ProxyDecryptor> weak_this = weak_ptr_factory_.GetWeakPtr(); |
| 199 return cdm_factory->Create( | 199 return cdm_factory->Create( |
| 200 key_system, | 200 key_system, |
| 201 true, // Prefixed always requires permission, and always allows | |
|
ddorwin
2015/03/06 21:42:54
This will DCHECK for AesDecryptor - or at least it
sandersd (OOO until July 31)
2015/03/06 22:36:58
Done.
| |
| 202 true, // distinctive identifiers and persistent state. | |
| 201 security_origin, | 203 security_origin, |
| 202 base::Bind(&ProxyDecryptor::OnSessionMessage, weak_this), | 204 base::Bind(&ProxyDecryptor::OnSessionMessage, weak_this), |
| 203 base::Bind(&ProxyDecryptor::OnSessionClosed, weak_this), | 205 base::Bind(&ProxyDecryptor::OnSessionClosed, weak_this), |
| 204 base::Bind(&ProxyDecryptor::OnSessionError, weak_this), | 206 base::Bind(&ProxyDecryptor::OnSessionError, weak_this), |
| 205 base::Bind(&ProxyDecryptor::OnSessionKeysChange, weak_this), | 207 base::Bind(&ProxyDecryptor::OnSessionKeysChange, weak_this), |
| 206 base::Bind(&ProxyDecryptor::OnSessionExpirationUpdate, weak_this)); | 208 base::Bind(&ProxyDecryptor::OnSessionExpirationUpdate, weak_this)); |
| 207 } | 209 } |
| 208 | 210 |
| 209 void ProxyDecryptor::OnSessionMessage(const std::string& session_id, | 211 void ProxyDecryptor::OnSessionMessage(const std::string& session_id, |
| 210 MediaKeys::MessageType message_type, | 212 MediaKeys::MessageType message_type, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 bool is_persistent = | 298 bool is_persistent = |
| 297 session_type == PersistentSession || session_type == LoadSession; | 299 session_type == PersistentSession || session_type == LoadSession; |
| 298 active_sessions_.insert(std::make_pair(session_id, is_persistent)); | 300 active_sessions_.insert(std::make_pair(session_id, is_persistent)); |
| 299 | 301 |
| 300 // For LoadSession(), generate the KeyAdded event. | 302 // For LoadSession(), generate the KeyAdded event. |
| 301 if (session_type == LoadSession) | 303 if (session_type == LoadSession) |
| 302 GenerateKeyAdded(session_id); | 304 GenerateKeyAdded(session_id); |
| 303 } | 305 } |
| 304 | 306 |
| 305 } // namespace media | 307 } // namespace media |
| OLD | NEW |