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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 2673693003: [wrapper-tracing] Don't call into V8 during heap snapshot creation (Closed)
Patch Set: Add DCHECK 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
index ad0f11b1d9bf46d062554580886b5ca12c7cc158..0d099ccade7b45cb3ee7e2b38107e2ec856cc787 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -135,7 +135,9 @@ class HeapSnaphotWrapperVisitor : public ScriptWrappableVisitor,
: ScriptWrappableVisitor(isolate),
m_currentParent(nullptr),
m_onlyTraceSingleLevel(false),
- m_firstScriptWrappableTraced(false) {}
+ m_firstScriptWrappableTraced(false) {
+ DCHECK(isMainThread());
+ }
// Collect interesting V8 roots for the heap snapshot. Currently these are
// DOM nodes.
@@ -195,6 +197,14 @@ class HeapSnaphotWrapperVisitor : public ScriptWrappableVisitor,
v8::HeapProfiler::RetainerEdges edges() { return std::move(m_edges); }
v8::HeapProfiler::RetainerGroups groups() { return std::move(m_groups); }
+ void markWrappersInAllWorlds(
+ const ScriptWrappable* traceable) const override {
+ // Only mark the main thread wrapper as we cannot properly intercept
+ // DOMWrapperMap::markWrapper. This means that edges from the isolated
+ // worlds are missing in the snapshot.
+ traceable->markWrapper(this);
+ }
+
void markWrapper(const v8::PersistentBase<v8::Value>* value) const override {
if (m_currentParent && m_currentParent != value)
m_edges.push_back(std::make_pair(m_currentParent, value));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698