| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 template <typename T> | 135 template <typename T> |
| 136 struct WebPassTypeImpl<OwnPtr<T>> { | 136 struct WebPassTypeImpl<OwnPtr<T>> { |
| 137 using Type = std::unique_ptr<T>; | 137 using Type = std::unique_ptr<T>; |
| 138 }; | 138 }; |
| 139 template <typename T> using PassType = typename PassTypeImpl<T>::Type; | 139 template <typename T> using PassType = typename PassTypeImpl<T>::Type; |
| 140 template <typename T> using WebPassType = typename WebPassTypeImpl<T>::Type; | 140 template <typename T> using WebPassType = typename WebPassTypeImpl<T>::Type; |
| 141 template <typename T> static T& adopt(T& x) { return x; } | 141 template <typename T> static T& adopt(T& x) { return x; } |
| 142 template <typename T> | 142 template <typename T> |
| 143 static PassOwnPtr<T> adopt(std::unique_ptr<T>& x) { return adoptPtr(x.releas
e()); } | 143 static PassOwnPtr<T> adopt(std::unique_ptr<T>& x) { return adoptPtr(x.releas
e()); } |
| 144 template <typename T> static PassType<T> pass(T& x) { return x; } | 144 template <typename T> static PassType<T> pass(T& x) { return x; } |
| 145 template <typename T> static PassOwnPtr<T> pass(OwnPtr<T>& x) { return x.rel
ease(); } | 145 template <typename T> static PassOwnPtr<T> pass(OwnPtr<T>& x) { return std::
move(x); } |
| 146 | 146 |
| 147 template <typename S, typename T> | 147 template <typename S, typename T> |
| 148 class Base : public WebCallbacks<WebPassType<typename S::WebType>, WebPassTy
pe<typename T::WebType>> { | 148 class Base : public WebCallbacks<WebPassType<typename S::WebType>, WebPassTy
pe<typename T::WebType>> { |
| 149 public: | 149 public: |
| 150 explicit Base(ScriptPromiseResolver* resolver) : m_resolver(resolver) {} | 150 explicit Base(ScriptPromiseResolver* resolver) : m_resolver(resolver) {} |
| 151 ScriptPromiseResolver* resolver() { return m_resolver; } | 151 ScriptPromiseResolver* resolver() { return m_resolver; } |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 Persistent<ScriptPromiseResolver> m_resolver; | 154 Persistent<ScriptPromiseResolver> m_resolver; |
| 155 }; | 155 }; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 } // namespace internal | 217 } // namespace internal |
| 218 | 218 |
| 219 template <typename S, typename T> | 219 template <typename S, typename T> |
| 220 using CallbackPromiseAdapter = internal::CallbackPromiseAdapterInternal::Callbac
kPromiseAdapter<S, T>; | 220 using CallbackPromiseAdapter = internal::CallbackPromiseAdapterInternal::Callbac
kPromiseAdapter<S, T>; |
| 221 | 221 |
| 222 } // namespace blink | 222 } // namespace blink |
| 223 | 223 |
| 224 #endif | 224 #endif |
| OLD | NEW |