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 #ifndef V8HiddenValue_h | 5 #ifndef V8HiddenValue_h |
6 #define V8HiddenValue_h | 6 #define V8HiddenValue_h |
7 | 7 |
8 #include "bindings/core/v8/ScopedPersistent.h" | 8 #include "bindings/core/v8/ScopedPersistent.h" |
| 9 #include "bindings/core/v8/ScriptPromiseProperties.h" |
9 #include <v8.h> | 10 #include <v8.h> |
10 | 11 |
11 namespace WebCore { | 12 namespace WebCore { |
12 | 13 |
13 class ScriptWrappable; | 14 class ScriptWrappable; |
14 | 15 |
15 #define V8_HIDDEN_VALUES(V) \ | 16 #define V8_HIDDEN_VALUES(V) \ |
16 V(arrayBufferData) \ | 17 V(arrayBufferData) \ |
17 V(customElementAttached) \ | 18 V(customElementAttached) \ |
18 V(customElementAttributeChanged) \ | 19 V(customElementAttributeChanged) \ |
(...skipping 11 matching lines...) Expand all Loading... |
30 V(document) \ | 31 V(document) \ |
31 V(error) \ | 32 V(error) \ |
32 V(event) \ | 33 V(event) \ |
33 V(idbCursorRequest) \ | 34 V(idbCursorRequest) \ |
34 V(port1) \ | 35 V(port1) \ |
35 V(port2) \ | 36 V(port2) \ |
36 V(state) \ | 37 V(state) \ |
37 V(stringData) \ | 38 V(stringData) \ |
38 V(scriptState) \ | 39 V(scriptState) \ |
39 V(thenableHiddenPromise) \ | 40 V(thenableHiddenPromise) \ |
40 V(toStringString) | 41 V(toStringString) \ |
| 42 SCRIPT_PROMISE_PROPERTIES(V, Promise) \ |
| 43 SCRIPT_PROMISE_PROPERTIES(V, Resolver) |
41 | 44 |
42 class V8HiddenValue { | 45 class V8HiddenValue { |
43 public: | 46 public: |
44 #define V8_DECLARE_METHOD(name) static v8::Handle<v8::String> name(v8::Isolate*
isolate); | 47 #define V8_DECLARE_METHOD(name) static v8::Handle<v8::String> name(v8::Isolate*
isolate); |
45 V8_HIDDEN_VALUES(V8_DECLARE_METHOD); | 48 V8_HIDDEN_VALUES(V8_DECLARE_METHOD); |
46 #undef V8_DECLARE_METHOD | 49 #undef V8_DECLARE_METHOD |
47 | 50 |
48 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Handle<v8::Obje
ct>, v8::Handle<v8::String>); | 51 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Handle<v8::Obje
ct>, v8::Handle<v8::String>); |
49 static bool setHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Handle<
v8::String>, v8::Handle<v8::Value>); | 52 static bool setHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Handle<
v8::String>, v8::Handle<v8::Value>); |
50 static bool deleteHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Hand
le<v8::String>); | 53 static bool deleteHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Hand
le<v8::String>); |
51 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*,
ScriptWrappable*, v8::Handle<v8::String>); | 54 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*,
ScriptWrappable*, v8::Handle<v8::String>); |
52 | 55 |
53 private: | 56 private: |
54 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name; | 57 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name; |
55 V8_HIDDEN_VALUES(V8_DECLARE_FIELD); | 58 V8_HIDDEN_VALUES(V8_DECLARE_FIELD); |
56 #undef V8_DECLARE_FIELD | 59 #undef V8_DECLARE_FIELD |
57 }; | 60 }; |
58 | 61 |
59 } // namespace WebCore | 62 } // namespace WebCore |
60 | 63 |
61 #endif // V8HiddenValue_h | 64 #endif // V8HiddenValue_h |
OLD | NEW |