Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.h

Issue 2458573002: bindings: Store ScriptState in generated callback functions (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>,
23 public TraceWrapperBase { 23 public TraceWrapperBase {
24 public: 24 public:
25 static VoidCallbackFunctionModules* create(v8::Isolate* isolate, v8::Local<v 8::Function> callback) 25 static VoidCallbackFunctionModules* create(ScriptState* scriptState, v8::Loc al<v8::Function> callback)
26 { 26 {
27 return new VoidCallbackFunctionModules(isolate, callback); 27 return new VoidCallbackFunctionModules(scriptState, callback);
28 } 28 }
29 29
30 ~VoidCallbackFunctionModules() = default; 30 ~VoidCallbackFunctionModules() = default;
31 31
32 DECLARE_TRACE(); 32 DECLARE_TRACE();
33 DECLARE_TRACE_WRAPPERS(); 33 DECLARE_TRACE_WRAPPERS();
34 34
35 bool call(ScriptState* scriptState, ScriptWrappable* scriptWrappable); 35 bool call(ScriptWrappable* scriptWrappable);
36 36
37 v8::Local<v8::Function> v8Value(v8::Isolate* isolate) 37 v8::Local<v8::Function> v8Value(v8::Isolate* isolate)
38 { 38 {
39 return m_callback.newLocal(isolate); 39 return m_callback.newLocal(isolate);
40 } 40 }
41 41
42 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Obje ct>& wrapper) 42 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Obje ct>& wrapper)
43 { 43 {
44 DCHECK(!m_callback.isEmpty()); 44 DCHECK(!m_callback.isEmpty());
45 m_callback.setReference(wrapper, isolate); 45 m_callback.setReference(wrapper, isolate);
46 } 46 }
47 47
48 private: 48 private:
49 VoidCallbackFunctionModules(v8::Isolate* isolate, v8::Local<v8::Function>); 49 VoidCallbackFunctionModules(ScriptState*, v8::Local<v8::Function>);
50
51 RefPtr<ScriptState> m_scriptState;
50 ScopedPersistent<v8::Function> m_callback; 52 ScopedPersistent<v8::Function> m_callback;
51 }; 53 };
52 54
53 } // namespace blink 55 } // namespace blink
54 56
55 #endif // VoidCallbackFunctionModules_h 57 #endif // VoidCallbackFunctionModules_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698