| 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 #ifndef MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ | 5 #ifndef MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ |
| 6 #define MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ | 6 #define MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool has_additional_usable_key, | 123 bool has_additional_usable_key, |
| 124 CdmKeysInfo keys_info); | 124 CdmKeysInfo keys_info); |
| 125 void OnSessionExpirationUpdate(const std::string& session_id, | 125 void OnSessionExpirationUpdate(const std::string& session_id, |
| 126 base::Time new_expiry_time); | 126 base::Time new_expiry_time); |
| 127 void OnSessionClosed(const std::string& session_id); | 127 void OnSessionClosed(const std::string& session_id); |
| 128 | 128 |
| 129 // Helper function of the callbacks. | 129 // Helper function of the callbacks. |
| 130 WebContentDecryptionModuleSessionImpl* GetSession( | 130 WebContentDecryptionModuleSessionImpl* GetSession( |
| 131 const std::string& session_id); | 131 const std::string& session_id); |
| 132 | 132 |
| 133 void ReportTimeToCreateCdmUMA(base::TimeDelta cdm_creation_time) const; | |
| 134 | |
| 135 scoped_refptr<ContentDecryptionModule> cdm_; | 133 scoped_refptr<ContentDecryptionModule> cdm_; |
| 136 | 134 |
| 137 SessionMap sessions_; | 135 SessionMap sessions_; |
| 138 | 136 |
| 139 std::string key_system_; | 137 std::string key_system_; |
| 140 std::string key_system_uma_prefix_; | 138 std::string key_system_uma_prefix_; |
| 141 | 139 |
| 142 // A unique ID to trace CdmSessionAdapter::CreateCdm() call and the matching | 140 // A unique ID to trace CdmSessionAdapter::CreateCdm() call and the matching |
| 143 // OnCdmCreated() call. | 141 // OnCdmCreated() call. |
| 144 uint32_t trace_id_; | 142 uint32_t trace_id_; |
| 145 | 143 |
| 146 std::unique_ptr<blink::WebContentDecryptionModuleResult> cdm_created_result_; | 144 std::unique_ptr<blink::WebContentDecryptionModuleResult> cdm_created_result_; |
| 147 | 145 |
| 148 // NOTE: Weak pointers must be invalidated before all other member variables. | 146 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 149 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; | 147 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; |
| 150 | 148 |
| 151 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); | 149 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); |
| 152 }; | 150 }; |
| 153 | 151 |
| 154 } // namespace media | 152 } // namespace media |
| 155 | 153 |
| 156 #endif // MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ | 154 #endif // MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ |
| OLD | NEW |