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 24 matching lines...) Expand all Loading... | |
35 DCHECK(!key_added_cb_.is_null()); | 35 DCHECK(!key_added_cb_.is_null()); |
36 DCHECK(!key_error_cb_.is_null()); | 36 DCHECK(!key_error_cb_.is_null()); |
37 DCHECK(!key_message_cb_.is_null()); | 37 DCHECK(!key_message_cb_.is_null()); |
38 } | 38 } |
39 | 39 |
40 ProxyDecryptor::~ProxyDecryptor() { | 40 ProxyDecryptor::~ProxyDecryptor() { |
41 // Destroy the decryptor explicitly before destroying the plugin. | 41 // Destroy the decryptor explicitly before destroying the plugin. |
42 media_keys_.reset(); | 42 media_keys_.reset(); |
43 } | 43 } |
44 | 44 |
45 Decryptor* ProxyDecryptor::GetDecryptor() { | 45 Decryptor* ProxyDecryptor::GetDecryptor() { |
ddorwin
2014/11/21 05:04:27
It doesn't matter much, but we _could_ possibly re
xhwang
2014/11/21 05:15:41
This will return a CdmContext in the next CL.
| |
46 return media_keys_ ? media_keys_->GetDecryptor() : NULL; | 46 return media_keys_ ? media_keys_->GetCdmContext()->GetDecryptor() : NULL; |
47 } | 47 } |
48 | 48 |
49 #if defined(ENABLE_BROWSER_CDMS) | 49 #if defined(ENABLE_BROWSER_CDMS) |
50 int ProxyDecryptor::GetCdmId() { | 50 int ProxyDecryptor::GetCdmId() { |
51 return media_keys_->GetCdmId(); | 51 return media_keys_->GetCdmContext()->GetCdmId(); |
52 } | 52 } |
53 #endif | 53 #endif |
54 | 54 |
55 bool ProxyDecryptor::InitializeCDM(CdmFactory* cdm_factory, | 55 bool ProxyDecryptor::InitializeCDM(CdmFactory* cdm_factory, |
56 const std::string& key_system, | 56 const std::string& key_system, |
57 const GURL& security_origin) { | 57 const GURL& security_origin) { |
58 DVLOG(1) << "InitializeCDM: key_system = " << key_system; | 58 DVLOG(1) << "InitializeCDM: key_system = " << key_system; |
59 | 59 |
60 DCHECK(!media_keys_); | 60 DCHECK(!media_keys_); |
61 media_keys_ = CreateMediaKeys(cdm_factory, key_system, security_origin); | 61 media_keys_ = CreateMediaKeys(cdm_factory, key_system, security_origin); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 bool is_persistent = | 315 bool is_persistent = |
316 session_type == PersistentSession || session_type == LoadSession; | 316 session_type == PersistentSession || session_type == LoadSession; |
317 active_sessions_.insert(std::make_pair(web_session_id, is_persistent)); | 317 active_sessions_.insert(std::make_pair(web_session_id, is_persistent)); |
318 | 318 |
319 // For LoadSession(), generate the SessionReady event. | 319 // For LoadSession(), generate the SessionReady event. |
320 if (session_type == LoadSession) | 320 if (session_type == LoadSession) |
321 OnSessionReady(web_session_id); | 321 OnSessionReady(web_session_id); |
322 } | 322 } |
323 | 323 |
324 } // namespace media | 324 } // namespace media |
OLD | NEW |