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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 }; | 50 }; |
51 | 51 |
52 template <typename T> | 52 template <typename T> |
53 class MEDIA_EXPORT CdmPromiseTemplate : public CdmPromise { | 53 class MEDIA_EXPORT CdmPromiseTemplate : public CdmPromise { |
54 public: | 54 public: |
55 CdmPromiseTemplate(base::Callback<void(const T&)> resolve_cb, | 55 CdmPromiseTemplate(base::Callback<void(const T&)> resolve_cb, |
56 PromiseRejectedCB rejected_cb); | 56 PromiseRejectedCB rejected_cb); |
57 virtual ~CdmPromiseTemplate(); | 57 virtual ~CdmPromiseTemplate(); |
58 virtual void resolve(const T& result); | 58 virtual void resolve(const T& result); |
59 | 59 |
60 protected: | |
61 // Allow subclasses to completely override the implementation. | |
62 // TODO(jrummell): Remove when derived classes are no longer needed. | |
ddorwin
2014/08/13 21:35:52
Which derived classes? Be specific so it's easy to
jrummell
2014/08/13 21:44:08
Done.
| |
63 CdmPromiseTemplate(); | |
64 | |
60 private: | 65 private: |
61 base::Callback<void(const T&)> resolve_cb_; | 66 base::Callback<void(const T&)> resolve_cb_; |
62 | 67 |
63 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); | 68 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); |
64 }; | 69 }; |
65 | 70 |
66 // Specialization for no parameter to resolve(). | 71 // Specialization for no parameter to resolve(). |
67 template <> | 72 template <> |
68 class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise { | 73 class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise { |
69 public: | 74 public: |
70 CdmPromiseTemplate(base::Callback<void(void)> resolve_cb, | 75 CdmPromiseTemplate(base::Callback<void(void)> resolve_cb, |
71 PromiseRejectedCB rejected_cb); | 76 PromiseRejectedCB rejected_cb); |
72 virtual ~CdmPromiseTemplate(); | 77 virtual ~CdmPromiseTemplate(); |
73 virtual void resolve(); | 78 virtual void resolve(); |
74 | 79 |
75 protected: | 80 protected: |
76 // Allow subclasses to completely override the implementation. | 81 // Allow subclasses to completely override the implementation. |
77 CdmPromiseTemplate(); | 82 CdmPromiseTemplate(); |
78 | 83 |
79 private: | 84 private: |
80 base::Callback<void(void)> resolve_cb_; | 85 base::Callback<void(void)> resolve_cb_; |
81 | 86 |
82 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); | 87 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); |
83 }; | 88 }; |
84 | 89 |
85 } // namespace media | 90 } // namespace media |
86 | 91 |
87 #endif // MEDIA_BASE_CDM_PROMISE_H_ | 92 #endif // MEDIA_BASE_CDM_PROMISE_H_ |
OLD | NEW |