| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef CallbackPromiseAdapter_h | 31 #ifndef CallbackPromiseAdapter_h |
| 32 #define CallbackPromiseAdapter_h | 32 #define CallbackPromiseAdapter_h |
| 33 | 33 |
| 34 #include <memory> |
| 35 #include <utility> |
| 34 #include "bindings/core/v8/ScriptPromiseResolver.h" | 36 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 35 #include "public/platform/WebCallbacks.h" | 37 #include "public/platform/WebCallbacks.h" |
| 36 #include "wtf/PtrUtil.h" | 38 #include "wtf/PtrUtil.h" |
| 37 #include "wtf/TypeTraits.h" | 39 #include "wtf/TypeTraits.h" |
| 38 #include <memory> | |
| 39 #include <utility> | |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 // CallbackPromiseAdapter is a WebCallbacks subclass and resolves / rejects the | 43 // CallbackPromiseAdapter is a WebCallbacks subclass and resolves / rejects the |
| 44 // stored resolver when onSuccess / onError is called, respectively. | 44 // stored resolver when onSuccess / onError is called, respectively. |
| 45 // | 45 // |
| 46 // Basically CallbackPromiseAdapter<S, T> is a subclass of | 46 // Basically CallbackPromiseAdapter<S, T> is a subclass of |
| 47 // WebCallbacks<S::WebType, T::WebType>. There are some exceptions: | 47 // WebCallbacks<S::WebType, T::WebType>. There are some exceptions: |
| 48 // - If S or T don't have WebType (e.g. S = bool), a default WebType holder | 48 // - If S or T don't have WebType (e.g. S = bool), a default WebType holder |
| 49 // called trivial WebType holder is used. For example, | 49 // called trivial WebType holder is used. For example, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 } // namespace internal | 207 } // namespace internal |
| 208 | 208 |
| 209 template <typename S, typename T> | 209 template <typename S, typename T> |
| 210 using CallbackPromiseAdapter = | 210 using CallbackPromiseAdapter = |
| 211 internal::CallbackPromiseAdapterInternal::CallbackPromiseAdapter<S, T>; | 211 internal::CallbackPromiseAdapterInternal::CallbackPromiseAdapter<S, T>; |
| 212 | 212 |
| 213 } // namespace blink | 213 } // namespace blink |
| 214 | 214 |
| 215 #endif | 215 #endif |
| OLD | NEW |