| 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 "media/blink/cdm_session_adapter.h" | 5 #include "media/blink/cdm_session_adapter.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 std::unique_ptr<SimpleCdmPromise> promise) { | 116 std::unique_ptr<SimpleCdmPromise> promise) { |
| 117 cdm_->CloseSession(session_id, std::move(promise)); | 117 cdm_->CloseSession(session_id, std::move(promise)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void CdmSessionAdapter::RemoveSession( | 120 void CdmSessionAdapter::RemoveSession( |
| 121 const std::string& session_id, | 121 const std::string& session_id, |
| 122 std::unique_ptr<SimpleCdmPromise> promise) { | 122 std::unique_ptr<SimpleCdmPromise> promise) { |
| 123 cdm_->RemoveSession(session_id, std::move(promise)); | 123 cdm_->RemoveSession(session_id, std::move(promise)); |
| 124 } | 124 } |
| 125 | 125 |
| 126 CdmContext* CdmSessionAdapter::GetCdmContext() { | 126 scoped_refptr<MediaKeys> CdmSessionAdapter::GetCdm() { |
| 127 return cdm_->GetCdmContext(); | 127 return cdm_; |
| 128 } | 128 } |
| 129 | 129 |
| 130 const std::string& CdmSessionAdapter::GetKeySystem() const { | 130 const std::string& CdmSessionAdapter::GetKeySystem() const { |
| 131 return key_system_; | 131 return key_system_; |
| 132 } | 132 } |
| 133 | 133 |
| 134 const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { | 134 const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { |
| 135 DCHECK(!key_system_uma_prefix_.empty()); | 135 DCHECK(!key_system_uma_prefix_.empty()); |
| 136 return key_system_uma_prefix_; | 136 return key_system_uma_prefix_; |
| 137 } | 137 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // Note: This leaks memory, which is expected behavior. | 222 // Note: This leaks memory, which is expected behavior. |
| 223 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet( | 223 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet( |
| 224 GetKeySystemUMAPrefix() + kTimeToCreateCdmUMAName, | 224 GetKeySystemUMAPrefix() + kTimeToCreateCdmUMAName, |
| 225 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(10), | 225 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(10), |
| 226 50, base::HistogramBase::kUmaTargetedHistogramFlag); | 226 50, base::HistogramBase::kUmaTargetedHistogramFlag); |
| 227 | 227 |
| 228 histogram->AddTime(time); | 228 histogram->AddTime(time); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace media | 231 } // namespace media |
| OLD | NEW |