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 CdmPromiseTemplate(); | |
ddorwin
2014/08/11 20:34:16
Add a TODO to remove it so we don't forget.
jrummell
2014/08/13 21:18:06
Done.
| |
63 | |
60 private: | 64 private: |
61 base::Callback<void(const T&)> resolve_cb_; | 65 base::Callback<void(const T&)> resolve_cb_; |
62 | 66 |
63 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); | 67 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); |
64 }; | 68 }; |
65 | 69 |
66 // Specialization for no parameter to resolve(). | 70 // Specialization for no parameter to resolve(). |
67 template <> | 71 template <> |
68 class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise { | 72 class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise { |
69 public: | 73 public: |
70 CdmPromiseTemplate(base::Callback<void(void)> resolve_cb, | 74 CdmPromiseTemplate(base::Callback<void(void)> resolve_cb, |
71 PromiseRejectedCB rejected_cb); | 75 PromiseRejectedCB rejected_cb); |
72 virtual ~CdmPromiseTemplate(); | 76 virtual ~CdmPromiseTemplate(); |
73 virtual void resolve(); | 77 virtual void resolve(); |
74 | 78 |
75 protected: | 79 protected: |
76 // Allow subclasses to completely override the implementation. | 80 // Allow subclasses to completely override the implementation. |
77 CdmPromiseTemplate(); | 81 CdmPromiseTemplate(); |
78 | 82 |
79 private: | 83 private: |
80 base::Callback<void(void)> resolve_cb_; | 84 base::Callback<void(void)> resolve_cb_; |
81 | 85 |
82 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); | 86 DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate); |
83 }; | 87 }; |
84 | 88 |
85 } // namespace media | 89 } // namespace media |
86 | 90 |
87 #endif // MEDIA_BASE_CDM_PROMISE_H_ | 91 #endif // MEDIA_BASE_CDM_PROMISE_H_ |
OLD | NEW |