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_BASE_CDM_PROMISE_H_ | 5 #ifndef MEDIA_BASE_CDM_PROMISE_H_ |
6 #define MEDIA_BASE_CDM_PROMISE_H_ | 6 #define MEDIA_BASE_CDM_PROMISE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 class MEDIA_EXPORT CdmPromiseTemplate : public CdmPromise { | 74 class MEDIA_EXPORT CdmPromiseTemplate : public CdmPromise { |
75 public: | 75 public: |
76 CdmPromiseTemplate(base::Callback<void(const T&)> resolve_cb, | 76 CdmPromiseTemplate(base::Callback<void(const T&)> resolve_cb, |
77 PromiseRejectedCB rejected_cb); | 77 PromiseRejectedCB rejected_cb); |
78 CdmPromiseTemplate(base::Callback<void(const T&)> resolve_cb, | 78 CdmPromiseTemplate(base::Callback<void(const T&)> resolve_cb, |
79 PromiseRejectedCB rejected_cb, | 79 PromiseRejectedCB rejected_cb, |
80 const std::string& uma_name); | 80 const std::string& uma_name); |
81 virtual ~CdmPromiseTemplate(); | 81 virtual ~CdmPromiseTemplate(); |
82 virtual void resolve(const T& result); | 82 virtual void resolve(const T& result); |
83 | 83 |
| 84 protected: |
| 85 // Allow subclasses to completely override the implementation. |
| 86 // TODO(jrummell): Remove when derived class SessionLoadedPromise |
| 87 // (in ppapi_decryptor.cc) is no longer needed. |
| 88 CdmPromiseTemplate(); |
| 89 |
84 private: | 90 private: |
85 base::Callback<void(const T&)> resolve_cb_; | 91 base::Callback<void(const T&)> resolve_cb_; |
86 | 92 |
87 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); | 93 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); |
88 }; | 94 }; |
89 | 95 |
90 // Specialization for no parameter to resolve(). | 96 // Specialization for no parameter to resolve(). |
91 template <> | 97 template <> |
92 class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise { | 98 class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise { |
93 public: | 99 public: |
(...skipping 11 matching lines...) Expand all Loading... |
105 | 111 |
106 private: | 112 private: |
107 base::Callback<void(void)> resolve_cb_; | 113 base::Callback<void(void)> resolve_cb_; |
108 | 114 |
109 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); | 115 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); |
110 }; | 116 }; |
111 | 117 |
112 } // namespace media | 118 } // namespace media |
113 | 119 |
114 #endif // MEDIA_BASE_CDM_PROMISE_H_ | 120 #endif // MEDIA_BASE_CDM_PROMISE_H_ |
OLD | NEW |