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