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

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

Issue 2625093002: [wrapper-tracing] Add heap snapshot generator infrastructure (Closed)
Patch Set: Rebase and fix CHECK Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
index f64cdb08738cda741ad2e7ed522262a3a6f0f152..4be6a52788f3dc08dbd27ecd00e4662dd70f38b2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
@@ -46,6 +46,7 @@ class CORE_EXPORT TraceWrapperBase {
public:
TraceWrapperBase() = default;
+ virtual bool isScriptWrappable() const { return false; }
DECLARE_VIRTUAL_TRACE_WRAPPERS(){};
};
@@ -62,6 +63,8 @@ class CORE_EXPORT ScriptWrappable : public TraceWrapperBase {
public:
ScriptWrappable() {}
+ bool isScriptWrappable() const override { return true; }
+
template <typename T>
T* toImpl() {
// All ScriptWrappables are managed by the Blink GC heap; check that
@@ -166,6 +169,7 @@ class CORE_EXPORT ScriptWrappable : public TraceWrapperBase {
private:
// These classes are exceptionally allowed to use mainWorldWrapper().
friend class DOMDataStore;
+ friend class HeapSnaphotWrapperVisitor;
friend class V8HiddenValue;
friend class V8PrivateProperty;
friend class WebGLRenderingContextBase;
@@ -174,6 +178,13 @@ class CORE_EXPORT ScriptWrappable : public TraceWrapperBase {
return v8::Local<v8::Object>::New(isolate, m_mainWorldWrapper);
}
+ // Only use when really necessary, i.e., when passing over this
+ // ScriptWrappable's reference to V8. Should only be needed by GC
+ // infrastructure.
+ const v8::Persistent<v8::Object>* rawMainWorldWrapper() const {
+ return &m_mainWorldWrapper;
+ }
+
v8::Persistent<v8::Object> m_mainWorldWrapper;
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698