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
3 // found in the LICENSE file.
5 #ifndef V8HiddenValue_h
6 #define V8HiddenValue_h
8 #include "bindings/v8/ScopedPersistent.h"
13 class ScriptWrappable;
15 #define V8_HIDDEN_VALUES(V) \
17 V(customElementAttached) \
18 V(customElementAttributeChanged) \
19 V(customElementCreated) \
20 V(customElementDetached) \
21 V(customElementDocument) \
22 V(customElementIsInterfacePrototypeObject) \
23 V(customElementNamespaceURI) \
24 V(customElementTagName) \
25 V(customElementType) \
39 V(thenableHiddenPromise) \
44 #define V8_DECLARE_METHOD(name) static v8::Handle<v8::String> name(v8::Isolate* isolate);
45 V8_HIDDEN_VALUES(V8_DECLARE_METHOD);
46 #undef V8_DECLARE_METHOD
48 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Handle<v8::Object>, v8::Handle<v8::String>);
49 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::Handle<v8::String>);
51 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, ScriptWrappable*, v8::Handle<v8::String>);
54 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name;
55 V8_HIDDEN_VALUES(V8_DECLARE_FIELD);
56 #undef V8_DECLARE_FIELD
59 } // namespace WebCore
61 #endif // V8HiddenValue_h