Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h b/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h |
| index 759b00a726817d44b027d281c1386ad9797cf48f..cab0adf0af27fa27046c9bcb29d458ed37a166cb 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h |
| @@ -5,13 +5,14 @@ |
| #ifndef V8HiddenValue_h |
| #define V8HiddenValue_h |
| +#include <v8.h> |
| +#include <memory> |
| #include "bindings/core/v8/ScopedPersistent.h" |
| #include "bindings/core/v8/ScriptPromiseProperties.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 { |
| @@ -44,13 +45,17 @@ class ScriptWrappable; |
| SCRIPT_PROMISE_PROPERTIES(V, Promise) \ |
| SCRIPT_PROMISE_PROPERTIES(V, Resolver) |
| -class CORE_EXPORT V8HiddenValue { |
| +class CORE_EXPORT V8HiddenValue : public V8PerIsolateData::Data { |
| USING_FAST_MALLOC(V8HiddenValue); |
| WTF_MAKE_NONCOPYABLE(V8HiddenValue); |
| public: |
| - static std::unique_ptr<V8HiddenValue> create() { |
| - return WTF::wrapUnique(new V8HiddenValue()); |
| + static void initialize(v8::Isolate* isolate) { |
| + V8PerIsolateData::from(isolate)->setHiddenValue(new V8HiddenValue()); |
| + } |
| + static V8HiddenValue* from(v8::Isolate* isolate) { |
|
Yuki
2017/02/15 10:00:40
No need to expose this method as public:, I think.
|
| + return static_cast<V8HiddenValue*>( |
| + V8PerIsolateData::from(isolate)->hiddenValue()); |
| } |
| #define V8_DECLARE_METHOD(name) \ |