| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 WebFunction_h | 5 #ifndef WebFunction_h |
| 6 #define WebFunction_h | 6 #define WebFunction_h |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 public: | 36 public: |
| 37 #if BLINK_IMPLEMENTATION | 37 #if BLINK_IMPLEMENTATION |
| 38 WebFunction() | 38 WebFunction() |
| 39 { | 39 { |
| 40 } | 40 } |
| 41 | 41 |
| 42 explicit WebFunction(std::unique_ptr<WTFFunction> c) | 42 explicit WebFunction(std::unique_ptr<WTFFunction> c) |
| 43 { | 43 { |
| 44 m_callback = static_cast<base::Callback<R(Args...)>>(*c); | 44 m_callback = convertToBaseCallback(std::move(c)); |
| 45 } | 45 } |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 WebFunction(WebFunction&& other) | 48 WebFunction(WebFunction&& other) |
| 49 { | 49 { |
| 50 *this = std::move(other); | 50 *this = std::move(other); |
| 51 } | 51 } |
| 52 WebFunction& operator=(WebFunction&& other) | 52 WebFunction& operator=(WebFunction&& other) |
| 53 { | 53 { |
| 54 #if DCHECK_IS_ON() | 54 #if DCHECK_IS_ON() |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 base::Callback<R(Args...)> m_callback; | 79 base::Callback<R(Args...)> m_callback; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(WebFunction); | 81 DISALLOW_COPY_AND_ASSIGN(WebFunction); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 using WebClosure = WebFunction<void()>; | 84 using WebClosure = WebFunction<void()>; |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| 87 | 87 |
| 88 #endif // WebClosure_h | 88 #endif // WebClosure_h |
| OLD | NEW |