Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h |
| index f81ba5891c6cb26e86032cb5b2712108da501cbc..9cfd0fd25108b67471ee3addbc815c19fe2de0ea 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h |
| @@ -5,15 +5,14 @@ |
| #ifndef V8PrivateProperty_h |
| #define V8PrivateProperty_h |
| +#include <v8.h> |
| +#include <memory> |
| #include "bindings/core/v8/ScopedPersistent.h" |
| -#include "bindings/core/v8/ScriptPromiseProperties.h" |
| #include "bindings/core/v8/V8BindingMacros.h" |
| #include "bindings/core/v8/V8PerIsolateData.h" |
| #include "core/CoreExport.h" |
| #include "wtf/Allocator.h" |
| #include "wtf/PtrUtil.h" |
| -#include <memory> |
| -#include <v8.h> |
| namespace blink { |
| @@ -67,7 +66,7 @@ class ScriptWrappable; |
| // auto private = V8PrivateProperty::createSymbol(isolate, symbolName, |
| // sizeof symbolName); |
| // ... |
| -class CORE_EXPORT V8PrivateProperty { |
| +class CORE_EXPORT V8PrivateProperty : public V8PerIsolateData::Data { |
| USING_FAST_MALLOC(V8PrivateProperty); |
| WTF_MAKE_NONCOPYABLE(V8PrivateProperty); |
| @@ -127,16 +126,20 @@ class CORE_EXPORT V8PrivateProperty { |
| v8::Local<v8::Private> m_privateSymbol; |
| }; |
| - static std::unique_ptr<V8PrivateProperty> create() { |
| - return WTF::wrapUnique(new V8PrivateProperty()); |
| + static void initialize(v8::Isolate* isolate) { |
| + V8PerIsolateData::from(isolate)->setPrivateProperty( |
| + new V8PrivateProperty()); |
| + } |
| + static V8PrivateProperty* from(v8::Isolate* isolate) { |
|
Yuki
2017/02/15 10:00:40
No need to expose this method as public:.
Should b
|
| + return static_cast<V8PrivateProperty*>( |
| + V8PerIsolateData::from(isolate)->privateProperty()); |
| } |
| #define V8_PRIVATE_PROPERTY_DEFINE_GETTER(InterfaceName, KeyName) \ |
| static Symbol V8_PRIVATE_PROPERTY_GETTER_NAME(InterfaceName, KeyName)( \ |
| v8::Isolate * isolate) /* NOLINT(readability/naming/underscores) */ \ |
| { \ |
| - V8PrivateProperty* privateProp = \ |
| - V8PerIsolateData::from(isolate)->privateProperty(); \ |
| + V8PrivateProperty* privateProp = from(isolate); \ |
| if (UNLIKELY(privateProp \ |
| ->V8_PRIVATE_PROPERTY_MEMBER_NAME(InterfaceName, KeyName) \ |
| .isEmpty())) { \ |