Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: media/base/cdm_promise.cc

Issue 448893002: Update ClearKey to support CDM_6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cdm6
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/cdm_promise.h ('k') | media/base/media_keys.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 template <typename T> 74 template <typename T>
75 CdmPromiseTemplate<T>::CdmPromiseTemplate( 75 CdmPromiseTemplate<T>::CdmPromiseTemplate(
76 base::Callback<void(const T&)> resolve_cb, 76 base::Callback<void(const T&)> resolve_cb,
77 PromiseRejectedCB reject_cb, 77 PromiseRejectedCB reject_cb,
78 const std::string& uma_name) 78 const std::string& uma_name)
79 : CdmPromise(reject_cb, uma_name), resolve_cb_(resolve_cb) { 79 : CdmPromise(reject_cb, uma_name), resolve_cb_(resolve_cb) {
80 DCHECK(!resolve_cb_.is_null()); 80 DCHECK(!resolve_cb_.is_null());
81 } 81 }
82 82
83 template <typename T> 83 template <typename T>
84 CdmPromiseTemplate<T>::CdmPromiseTemplate() {
85 }
86
87 template <typename T>
84 CdmPromiseTemplate<T>::~CdmPromiseTemplate() { 88 CdmPromiseTemplate<T>::~CdmPromiseTemplate() {
85 DCHECK(!is_pending_); 89 DCHECK(!is_pending_);
86 } 90 }
87 91
88 template <typename T> 92 template <typename T>
89 void CdmPromiseTemplate<T>::resolve(const T& result) { 93 void CdmPromiseTemplate<T>::resolve(const T& result) {
90 DCHECK(is_pending_); 94 DCHECK(is_pending_);
91 is_pending_ = false; 95 is_pending_ = false;
92 if (!uma_name_.empty()) { 96 if (!uma_name_.empty()) {
93 base::LinearHistogram::FactoryGet( 97 base::LinearHistogram::FactoryGet(
(...skipping 30 matching lines...) Expand all
124 if (!uma_name_.empty()) { 128 if (!uma_name_.empty()) {
125 base::LinearHistogram::FactoryGet( 129 base::LinearHistogram::FactoryGet(
126 uma_name_, 1, NUM_RESULT_CODES, NUM_RESULT_CODES + 1, 130 uma_name_, 1, NUM_RESULT_CODES, NUM_RESULT_CODES + 1,
127 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(SUCCESS); 131 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(SUCCESS);
128 } 132 }
129 resolve_cb_.Run(); 133 resolve_cb_.Run();
130 } 134 }
131 135
132 // Explicit template instantiation for the Promises needed. 136 // Explicit template instantiation for the Promises needed.
133 template class MEDIA_EXPORT CdmPromiseTemplate<std::string>; 137 template class MEDIA_EXPORT CdmPromiseTemplate<std::string>;
138 template class MEDIA_EXPORT CdmPromiseTemplate<KeyIdsVector>;
134 139
135 } // namespace media 140 } // namespace media
OLDNEW
« no previous file with comments | « media/base/cdm_promise.h ('k') | media/base/media_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698