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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h

Issue 2687943004: Abstract out ThreadDebugger from V8PerIsolateData (Closed)
Patch Set: Initialize HiddenValue and PrivateProperty in V8Initializer Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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) \

Powered by Google App Engine
This is Rietveld 408576698