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/base/cdm_promise.h" | 5 #include "media/base/cdm_promise.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 DCHECK(is_pending_); | 126 DCHECK(is_pending_); |
127 is_pending_ = false; | 127 is_pending_ = false; |
128 if (!uma_name_.empty()) { | 128 if (!uma_name_.empty()) { |
129 base::LinearHistogram::FactoryGet( | 129 base::LinearHistogram::FactoryGet( |
130 uma_name_, 1, NUM_RESULT_CODES, NUM_RESULT_CODES + 1, | 130 uma_name_, 1, NUM_RESULT_CODES, NUM_RESULT_CODES + 1, |
131 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(SUCCESS); | 131 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(SUCCESS); |
132 } | 132 } |
133 resolve_cb_.Run(); | 133 resolve_cb_.Run(); |
134 } | 134 } |
135 | 135 |
| 136 CdmPromise::ResolveParameterType |
| 137 CdmPromiseTemplate<void>::GetResolveParameterType() const { |
| 138 return VOID_TYPE; |
| 139 } |
| 140 |
| 141 template <> |
| 142 CdmPromise::ResolveParameterType |
| 143 CdmPromiseTemplate<std::string>::GetResolveParameterType() const { |
| 144 return STRING_TYPE; |
| 145 } |
| 146 |
| 147 template <> |
| 148 CdmPromise::ResolveParameterType |
| 149 CdmPromiseTemplate<KeyIdsVector>::GetResolveParameterType() const { |
| 150 return KEY_IDS_VECTOR_TYPE; |
| 151 } |
| 152 |
136 // Explicit template instantiation for the Promises needed. | 153 // Explicit template instantiation for the Promises needed. |
137 template class MEDIA_EXPORT CdmPromiseTemplate<std::string>; | 154 template class MEDIA_EXPORT CdmPromiseTemplate<std::string>; |
138 template class MEDIA_EXPORT CdmPromiseTemplate<KeyIdsVector>; | 155 template class MEDIA_EXPORT CdmPromiseTemplate<KeyIdsVector>; |
139 | 156 |
140 } // namespace media | 157 } // namespace media |
OLD | NEW |