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

Side by Side Diff: Source/bindings/core/v8/V8HiddenValue.h

Issue 1278983003: Adding allocator annotations to blink classes and structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed patch conflict Created 5 years, 4 months 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
« no previous file with comments | « Source/bindings/core/v8/V8GlobalValueMap.h ('k') | Source/bindings/core/v8/V8IdleTaskRunner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 "core/CoreExport.h" 10 #include "core/CoreExport.h"
11 #include "wtf/Allocator.h"
12 #include "wtf/PassOwnPtr.h"
11 #include <v8.h> 13 #include <v8.h>
12 14
13 namespace blink { 15 namespace blink {
14 16
15 class ScriptWrappable; 17 class ScriptWrappable;
16 18
17 #define V8_HIDDEN_VALUES(V) \ 19 #define V8_HIDDEN_VALUES(V) \
18 V(arrayBufferData) \ 20 V(arrayBufferData) \
19 V(privateScriptObjectIsInitialized) \ 21 V(privateScriptObjectIsInitialized) \
20 V(customElementAttachedCallback) \ 22 V(customElementAttachedCallback) \
(...skipping 18 matching lines...) Expand all
39 V(state) \ 41 V(state) \
40 V(stringData) \ 42 V(stringData) \
41 V(testInterfaces) \ 43 V(testInterfaces) \
42 V(thenableHiddenPromise) \ 44 V(thenableHiddenPromise) \
43 V(toStringString) \ 45 V(toStringString) \
44 V(injectedScriptNative) \ 46 V(injectedScriptNative) \
45 SCRIPT_PROMISE_PROPERTIES(V, Promise) \ 47 SCRIPT_PROMISE_PROPERTIES(V, Promise) \
46 SCRIPT_PROMISE_PROPERTIES(V, Resolver) 48 SCRIPT_PROMISE_PROPERTIES(V, Resolver)
47 49
48 class CORE_EXPORT V8HiddenValue { 50 class CORE_EXPORT V8HiddenValue {
51 WTF_MAKE_FAST_ALLOCATED(V8HiddenValue);
52 WTF_MAKE_NONCOPYABLE(V8HiddenValue);
49 public: 53 public:
54 static PassOwnPtr<V8HiddenValue> create() { return adoptPtr(new V8HiddenValu e()); }
55
50 #define V8_DECLARE_METHOD(name) static v8::Local<v8::String> name(v8::Isolate* i solate); 56 #define V8_DECLARE_METHOD(name) static v8::Local<v8::String> name(v8::Isolate* i solate);
51 V8_HIDDEN_VALUES(V8_DECLARE_METHOD); 57 V8_HIDDEN_VALUES(V8_DECLARE_METHOD);
52 #undef V8_DECLARE_METHOD 58 #undef V8_DECLARE_METHOD
53 59
54 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Local<v8::Objec t>, v8::Local<v8::String>); 60 static v8::Local<v8::Value> getHiddenValue(v8::Isolate*, v8::Local<v8::Objec t>, v8::Local<v8::String>);
55 static bool setHiddenValue(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8 ::String>, v8::Local<v8::Value>); 61 static bool setHiddenValue(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8 ::String>, v8::Local<v8::Value>);
56 static bool deleteHiddenValue(v8::Isolate*, v8::Local<v8::Object>, v8::Local <v8::String>); 62 static bool deleteHiddenValue(v8::Isolate*, v8::Local<v8::Object>, v8::Local <v8::String>);
57 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, ScriptWrappable*, v8::Local<v8::String>); 63 static v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate*, ScriptWrappable*, v8::Local<v8::String>);
58 64
59 private: 65 private:
66 V8HiddenValue() { }
67
60 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name; 68 #define V8_DECLARE_FIELD(name) ScopedPersistent<v8::String> m_##name;
61 V8_HIDDEN_VALUES(V8_DECLARE_FIELD); 69 V8_HIDDEN_VALUES(V8_DECLARE_FIELD);
62 #undef V8_DECLARE_FIELD 70 #undef V8_DECLARE_FIELD
63 }; 71 };
64 72
65 } // namespace blink 73 } // namespace blink
66 74
67 #endif // V8HiddenValue_h 75 #endif // V8HiddenValue_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8GlobalValueMap.h ('k') | Source/bindings/core/v8/V8IdleTaskRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698