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 "bindings/core/v8/ScriptPromiseProperties.h" |
10 #include <v8.h> | 10 #include <v8.h> |
(...skipping 14 matching lines...) Expand all Loading... |
25 V(customElementNamespaceURI) \ | 25 V(customElementNamespaceURI) \ |
26 V(customElementTagName) \ | 26 V(customElementTagName) \ |
27 V(customElementType) \ | 27 V(customElementType) \ |
28 V(callback) \ | 28 V(callback) \ |
29 V(condition) \ | 29 V(condition) \ |
30 V(data) \ | 30 V(data) \ |
31 V(detail) \ | 31 V(detail) \ |
32 V(document) \ | 32 V(document) \ |
33 V(error) \ | 33 V(error) \ |
34 V(event) \ | 34 V(event) \ |
35 V(idbCursorRequest) \ | |
36 V(port1) \ | 35 V(port1) \ |
37 V(port2) \ | 36 V(port2) \ |
38 V(state) \ | 37 V(state) \ |
39 V(stringData) \ | 38 V(stringData) \ |
40 V(thenableHiddenPromise) \ | 39 V(thenableHiddenPromise) \ |
41 V(toStringString) \ | 40 V(toStringString) \ |
42 SCRIPT_PROMISE_PROPERTIES(V, Promise) \ | 41 SCRIPT_PROMISE_PROPERTIES(V, Promise) \ |
43 SCRIPT_PROMISE_PROPERTIES(V, Resolver) | 42 SCRIPT_PROMISE_PROPERTIES(V, Resolver) |
44 | 43 |
45 class V8HiddenValue { | 44 class V8HiddenValue { |
46 public: | 45 public: |
47 #define V8_DECLARE_METHOD(name) static v8::Handle<v8::String> name(v8::Isolate*
isolate); | 46 #define V8_DECLARE_METHOD(name) static v8::Handle<v8::String> name(v8::Isolate*
isolate); |
48 V8_HIDDEN_VALUES(V8_DECLARE_METHOD); | 47 V8_HIDDEN_VALUES(V8_DECLARE_METHOD); |
49 #undef V8_DECLARE_METHOD | 48 #undef V8_DECLARE_METHOD |
50 | 49 |
51 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Handle<v8::Obje
ct>, v8::Handle<v8::String>); | 50 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Handle<v8::Obje
ct>, v8::Handle<v8::String>); |
52 static bool setHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Handle<
v8::String>, v8::Handle<v8::Value>); | 51 static bool setHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Handle<
v8::String>, v8::Handle<v8::Value>); |
53 static bool deleteHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Hand
le<v8::String>); | 52 static bool deleteHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Hand
le<v8::String>); |
54 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*,
ScriptWrappable*, v8::Handle<v8::String>); | 53 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*,
ScriptWrappable*, v8::Handle<v8::String>); |
55 | 54 |
56 private: | 55 private: |
57 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name; | 56 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name; |
58 V8_HIDDEN_VALUES(V8_DECLARE_FIELD); | 57 V8_HIDDEN_VALUES(V8_DECLARE_FIELD); |
59 #undef V8_DECLARE_FIELD | 58 #undef V8_DECLARE_FIELD |
60 }; | 59 }; |
61 | 60 |
62 } // namespace blink | 61 } // namespace blink |
63 | 62 |
64 #endif // V8HiddenValue_h | 63 #endif // V8HiddenValue_h |
OLD | NEW |