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_adapter.h" | 5 #include "media/base/cdm_promise_adapter.h" |
6 | 6 |
7 #include "media/base/media_keys.h" | 7 #include "media/base/media_keys.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (type != expected) { | 39 if (type != expected) { |
40 NOTREACHED() << "Promise type mismatch: " << type << " vs " << expected; | 40 NOTREACHED() << "Promise type mismatch: " << type << " vs " << expected; |
41 return; | 41 return; |
42 } | 42 } |
43 | 43 |
44 static_cast<CdmPromiseTemplate<T...>*>(promise.get())->resolve(result...); | 44 static_cast<CdmPromiseTemplate<T...>*>(promise.get())->resolve(result...); |
45 } | 45 } |
46 | 46 |
47 void CdmPromiseAdapter::RejectPromise(uint32_t promise_id, | 47 void CdmPromiseAdapter::RejectPromise(uint32_t promise_id, |
48 MediaKeys::Exception exception_code, | 48 MediaKeys::Exception exception_code, |
49 uint32 system_code, | 49 uint32_t system_code, |
50 const std::string& error_message) { | 50 const std::string& error_message) { |
51 scoped_ptr<CdmPromise> promise = TakePromise(promise_id); | 51 scoped_ptr<CdmPromise> promise = TakePromise(promise_id); |
52 if (!promise) { | 52 if (!promise) { |
53 NOTREACHED() << "No promise found for promise_id " << promise_id; | 53 NOTREACHED() << "No promise found for promise_id " << promise_id; |
54 return; | 54 return; |
55 } | 55 } |
56 | 56 |
57 promise->reject(exception_code, system_code, error_message); | 57 promise->reject(exception_code, system_code, error_message); |
58 } | 58 } |
59 | 59 |
(...skipping 13 matching lines...) Expand all Loading... |
73 return promises_.take_and_erase(it); | 73 return promises_.take_and_erase(it); |
74 } | 74 } |
75 | 75 |
76 // Explicit instantiation of function templates. | 76 // Explicit instantiation of function templates. |
77 template MEDIA_EXPORT void CdmPromiseAdapter::ResolvePromise(uint32_t); | 77 template MEDIA_EXPORT void CdmPromiseAdapter::ResolvePromise(uint32_t); |
78 template MEDIA_EXPORT void CdmPromiseAdapter::ResolvePromise( | 78 template MEDIA_EXPORT void CdmPromiseAdapter::ResolvePromise( |
79 uint32_t, | 79 uint32_t, |
80 const std::string&); | 80 const std::string&); |
81 | 81 |
82 } // namespace media | 82 } // namespace media |
OLD | NEW |