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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.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/V8PerIsolateData.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h
index 0f3ff9ccfa3ac425d6f5a9549c2e387825da9034..898b6c2f3bee02629de0184a546b59f2c9581a50 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h
@@ -26,10 +26,11 @@
#ifndef V8PerIsolateData_h
#define V8PerIsolateData_h
+#include <v8.h>
Yuki 2017/02/15 10:00:40 Please use the following instead. #include "v8/in
+#include <memory>
Yuki 2017/02/15 10:00:40 Chromium's style guide recommends to put an empty
adithyas 2017/02/15 18:12:12 Running git cl format reordered the headers like t
#include "bindings/core/v8/ScopedPersistent.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/ScriptWrappableVisitor.h"
-#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
#include "core/CoreExport.h"
#include "gin/public/isolate_holder.h"
@@ -38,16 +39,12 @@
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
#include "wtf/Vector.h"
-#include <memory>
-#include <v8.h>
namespace blink {
class ActiveScriptWrappableBase;
class DOMDataStore;
class StringCache;
-class ThreadDebugger;
-class V8PrivateProperty;
class WebTaskRunner;
struct WrapperTypeInfo;
@@ -90,6 +87,14 @@ class CORE_EXPORT V8PerIsolateData {
const bool m_originalUseCounterDisabled;
};
+ class CORE_EXPORT Data {
+ WTF_MAKE_NONCOPYABLE(Data);
Yuki 2017/02/15 10:00:40 Why do we want Data to be non-copyable? I know sub
adithyas 2017/02/15 18:12:12 Yeah it doesn't need to be non-copyable, I've chan
+
+ public:
+ explicit Data() {}
jbroman 2017/02/14 18:10:48 nit: if you do keep this interface, you don't need
adithyas 2017/02/15 18:12:12 Removed.
+ virtual ~Data() {}
+ };
+
static v8::Isolate* initialize(WebTaskRunner*);
static V8PerIsolateData* from(v8::Isolate* isolate) {
@@ -122,8 +127,18 @@ class CORE_EXPORT V8PerIsolateData {
bool isReportingException() const { return m_isReportingException; }
void setReportingException(bool value) { m_isReportingException = value; }
- V8HiddenValue* hiddenValue() { return m_hiddenValue.get(); }
- V8PrivateProperty* privateProperty() { return m_privateProperty.get(); }
+ Data* hiddenValue() { return m_hiddenValue.get(); }
+ void setHiddenValue(Data* hiddenValue) { m_hiddenValue.reset(hiddenValue); }
+
+ Data* privateProperty() { return m_privateProperty.get(); }
+ void setPrivateProperty(Data* privateProperty) {
+ m_privateProperty.reset(privateProperty);
+ }
+
+ Data* threadDebugger() { return m_threadDebugger.get(); }
+ void setThreadDebugger(Data* threadDebugger) {
jbroman 2017/02/14 18:10:48 Please pass ownership by std::unique_ptr, not raw
adithyas 2017/02/15 18:12:12 Done.
+ m_threadDebugger.reset(threadDebugger);
+ }
// Accessors to the cache of interface templates.
v8::Local<v8::FunctionTemplate> findInterfaceTemplate(const DOMWrapperWorld&,
@@ -157,9 +172,6 @@ class CORE_EXPORT V8PerIsolateData {
void runEndOfScopeTasks();
void clearEndOfScopeTasks();
- void setThreadDebugger(std::unique_ptr<ThreadDebugger>);
- ThreadDebugger* threadDebugger();
-
using ActiveScriptWrappableSet =
HeapHashSet<WeakMember<ActiveScriptWrappableBase>>;
void addActiveScriptWrappable(ActiveScriptWrappableBase*);
@@ -230,9 +242,11 @@ class CORE_EXPORT V8PerIsolateData {
V8FunctionTemplateMap m_operationTemplateMapForMainWorld;
V8FunctionTemplateMap m_operationTemplateMapForNonMainWorld;
+ std::unique_ptr<Data> m_hiddenValue;
jbroman 2017/02/14 18:10:48 V8HiddenValue is going away, and V8PrivateProperty
haraken 2017/02/15 00:06:01 Yeah, agreed.
adithyas 2017/02/15 18:12:12 Okay, I reverted the changes to V8PrivateProperty
+ std::unique_ptr<Data> m_privateProperty;
+ std::unique_ptr<Data> m_threadDebugger;
jbroman 2017/02/14 18:10:48 I'm of two minds on this. On the short-term-fix s
haraken 2017/02/15 00:06:01 I don't have any strong opinion. The current Data
jbroman 2017/02/15 02:25:23 Alright, okay to leave m_threadDebugger as-is (mod
adithyas 2017/02/15 18:12:12 Done!
+
std::unique_ptr<StringCache> m_stringCache;
- std::unique_ptr<V8HiddenValue> m_hiddenValue;
- std::unique_ptr<V8PrivateProperty> m_privateProperty;
ScopedPersistent<v8::Value> m_liveRoot;
RefPtr<ScriptState> m_scriptRegexpScriptState;
@@ -246,7 +260,6 @@ class CORE_EXPORT V8PerIsolateData {
bool m_isReportingException;
Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks;
- std::unique_ptr<ThreadDebugger> m_threadDebugger;
Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables;
std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor;

Powered by Google App Engine
This is Rietveld 408576698