| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 V8PrivateProperty_h | 5 #ifndef V8PrivateProperty_h |
| 6 #define V8PrivateProperty_h | 6 #define V8PrivateProperty_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 "bindings/core/v8/V8BindingMacros.h" | 10 #include "bindings/core/v8/V8BindingMacros.h" |
| 11 #include "bindings/core/v8/V8PerIsolateData.h" | 11 #include "bindings/core/v8/V8PerIsolateData.h" |
| 12 #include "core/CoreExport.h" | 12 #include "core/CoreExport.h" |
| 13 #include "wtf/Allocator.h" | 13 #include "wtf/Allocator.h" |
| 14 #include "wtf/PtrUtil.h" | 14 #include "wtf/PtrUtil.h" |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <v8.h> | 16 #include <v8.h> |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 class ScriptState; | 20 class ScriptState; |
| 21 class ScriptWrappable; | 21 class ScriptWrappable; |
| 22 | 22 |
| 23 // Apply |X| for each pair of (InterfaceName, PrivateKeyName). | 23 // Apply |X| for each pair of (InterfaceName, PrivateKeyName). |
| 24 #define V8_PRIVATE_PROPERTY_FOR_EACH(X) \ | 24 #define V8_PRIVATE_PROPERTY_FOR_EACH(X) \ |
| 25 X(MessageEvent, CachedData) \ | 25 X(MessageEvent, CachedData) \ |
| 26 X(PrivateScriptRunner, IsInitialized) \ | 26 X(PrivateScriptRunner, IsInitialized) \ |
| 27 X(IntersectionObserver, Callback) \ | 27 X(IntersectionObserver, Callback) \ |
| 28 X(MutationObserver, Callback) \ | 28 X(MutationObserver, Callback) \ |
| 29 X(PerformanceObserver, Callback) | 29 X(PerformanceObserver, Callback) \ |
| 30 X(WebGLRenderingContext, Extensions) \ |
| 31 X(WebGLRenderingContext, Misc) \ |
| 32 X(WebGLRenderingContext, Queries) \ |
| 33 X(WebGLRenderingContext, Samplers) \ |
| 34 X(WebGLRenderingContext, Textures2D) \ |
| 35 X(WebGLRenderingContext, Textures2DArray) \ |
| 36 X(WebGLRenderingContext, Textures3D) \ |
| 37 X(WebGLRenderingContext, TexturesCubeMap) \ |
| 38 X(WebGLFramebuffer, Attachments) \ |
| 39 X(WebGLProgram, Shaders) \ |
| 40 X(WebGLVertexArrayObjectBase, Buffers) |
| 30 | 41 |
| 31 // The getter's name for a private property. | 42 // The getter's name for a private property. |
| 32 #define V8_PRIVATE_PROPERTY_GETTER_NAME(InterfaceName, PrivateKeyName) \ | 43 #define V8_PRIVATE_PROPERTY_GETTER_NAME(InterfaceName, PrivateKeyName) \ |
| 33 get##InterfaceName##PrivateKeyName | 44 get##InterfaceName##PrivateKeyName |
| 34 | 45 |
| 35 // The member variable's name for a private property. | 46 // The member variable's name for a private property. |
| 36 #define V8_PRIVATE_PROPERTY_MEMBER_NAME(InterfaceName, PrivateKeyName) \ | 47 #define V8_PRIVATE_PROPERTY_MEMBER_NAME(InterfaceName, PrivateKeyName) \ |
| 37 m_symbol##InterfaceName##PrivateKeyName | 48 m_symbol##InterfaceName##PrivateKeyName |
| 38 | 49 |
| 39 // The string used to create a private symbol. Must be unique per V8 instance. | 50 // The string used to create a private symbol. Must be unique per V8 instance. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 146 |
| 136 #define V8_PRIVATE_PROPERTY_DECLARE_MEMBER(InterfaceName, KeyName) \ | 147 #define V8_PRIVATE_PROPERTY_DECLARE_MEMBER(InterfaceName, KeyName) \ |
| 137 ScopedPersistent<v8::Private> V8_PRIVATE_PROPERTY_MEMBER_NAME(InterfaceName,
KeyName); // NOLINT(readability/naming/underscores) | 148 ScopedPersistent<v8::Private> V8_PRIVATE_PROPERTY_MEMBER_NAME(InterfaceName,
KeyName); // NOLINT(readability/naming/underscores) |
| 138 V8_PRIVATE_PROPERTY_FOR_EACH(V8_PRIVATE_PROPERTY_DECLARE_MEMBER) | 149 V8_PRIVATE_PROPERTY_FOR_EACH(V8_PRIVATE_PROPERTY_DECLARE_MEMBER) |
| 139 #undef V8_PRIVATE_PROPERTY_DECLARE_MEMBER | 150 #undef V8_PRIVATE_PROPERTY_DECLARE_MEMBER |
| 140 }; | 151 }; |
| 141 | 152 |
| 142 } // namespace blink | 153 } // namespace blink |
| 143 | 154 |
| 144 #endif // V8PrivateProperty_h | 155 #endif // V8PrivateProperty_h |
| OLD | NEW |