| 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 // This file has been auto-generated by code_generator_v8.py. | 5 // This file has been auto-generated by code_generator_v8.py. |
| 6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
| 7 | 7 |
| 8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl | 9 // third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl |
| 10 | 10 |
| 11 // clang-format off | 11 // clang-format off |
| 12 | 12 |
| 13 #ifndef VoidCallbackFunctionModules_h | 13 #ifndef VoidCallbackFunctionModules_h |
| 14 #define VoidCallbackFunctionModules_h | 14 #define VoidCallbackFunctionModules_h |
| 15 | 15 |
| 16 #include "bindings/core/v8/ScriptWrappable.h" | 16 #include "bindings/core/v8/ScriptWrappable.h" |
| 17 #include "bindings/core/v8/TraceWrapperV8Reference.h" | 17 #include "bindings/core/v8/TraceWrapperV8Reference.h" |
| 18 #include "modules/ModulesExport.h" | 18 #include "modules/ModulesExport.h" |
| 19 #include "platform/heap/Handle.h" | 19 #include "platform/heap/Handle.h" |
| 20 #include "wtf/text/WTFString.h" | 20 #include "wtf/text/WTFString.h" |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 | 23 |
| 24 class ScriptState; | 24 class ScriptState; |
| 25 | 25 |
| 26 class MODULES_EXPORT VoidCallbackFunctionModules final : public GarbageCollected
Finalized<VoidCallbackFunctionModules>, public TraceWrapperBase { | 26 class MODULES_EXPORT VoidCallbackFunctionModules final : public GarbageCollected
Finalized<VoidCallbackFunctionModules>, public TraceWrapperBase { |
| 27 public: | 27 public: |
| 28 static VoidCallbackFunctionModules* create(ScriptState* scriptState, v8::Local
<v8::Function> callback) { | 28 static VoidCallbackFunctionModules* create(ScriptState* scriptState, v8::Local
<v8::Value> callback); |
| 29 return new VoidCallbackFunctionModules(scriptState, callback); | |
| 30 } | |
| 31 | 29 |
| 32 ~VoidCallbackFunctionModules() = default; | 30 ~VoidCallbackFunctionModules() = default; |
| 33 | 31 |
| 34 DECLARE_TRACE(); | 32 DECLARE_TRACE(); |
| 35 DECLARE_TRACE_WRAPPERS(); | 33 DECLARE_TRACE_WRAPPERS(); |
| 36 | 34 |
| 37 bool call(ScriptWrappable* scriptWrappable); | 35 bool call(ScriptWrappable* scriptWrappable); |
| 38 | 36 |
| 39 v8::Local<v8::Function> v8Value(v8::Isolate* isolate) { | 37 v8::Local<v8::Function> v8Value(v8::Isolate* isolate) { |
| 40 return m_callback.newLocal(isolate); | 38 return m_callback.newLocal(isolate); |
| 41 } | 39 } |
| 42 | 40 |
| 43 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Object
>& wrapper) { | 41 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Object
>& wrapper) { |
| 44 DCHECK(!m_callback.isEmpty()); | 42 DCHECK(!m_callback.isEmpty()); |
| 45 m_callback.setReference(wrapper, isolate); | 43 m_callback.setReference(wrapper, isolate); |
| 46 } | 44 } |
| 47 | 45 |
| 48 private: | 46 private: |
| 49 VoidCallbackFunctionModules(ScriptState*, v8::Local<v8::Function>); | 47 VoidCallbackFunctionModules(ScriptState*, v8::Local<v8::Function>); |
| 50 | 48 |
| 51 RefPtr<ScriptState> m_scriptState; | 49 RefPtr<ScriptState> m_scriptState; |
| 52 TraceWrapperV8Reference<v8::Function> m_callback; | 50 TraceWrapperV8Reference<v8::Function> m_callback; |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 } // namespace blink | 53 } // namespace blink |
| 56 | 54 |
| 57 #endif // VoidCallbackFunctionModules_h | 55 #endif // VoidCallbackFunctionModules_h |
| OLD | NEW |