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

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

Issue 2651923002: [wrapper-tracing] Snapshot: Avoid adding non-Node wrappers to groups (Closed)
Patch Set: Fix typo 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 | 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 b16daebe6e96bc124db685c6833445219dd652fe..b740aec7bb03a16e170237be8a7185f1f80f969e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -203,8 +203,11 @@ class HeapSnaphotWrapperVisitor : public ScriptWrappableVisitor,
for (auto& groupPair : m_nodesRequiringTracing) {
v8::HeapProfiler::RetainerChildren groupChildren;
for (auto& node : groupPair.second) {
- auto wrappers = findV8WrappersDirectlyReachableFrom(node);
- groupChildren.insert(wrappers.begin(), wrappers.end());
+ // Ignore the actual wrappers reachable as we only want to create
+ // groups of DOM nodes. The method is still used to collect edges
+ // though.
+ findV8WrappersDirectlyReachableFrom(node);
haraken 2017/01/24 21:04:58 Now, isn't it useless to call findV8WrappersDirect
+ groupChildren.insert(persistentForWrappable(node));
}
m_groups.push_back(std::make_pair(new RetainedDOMInfo(groupPair.first),
std::move(groupChildren)));
@@ -231,13 +234,17 @@ class HeapSnaphotWrapperVisitor : public ScriptWrappableVisitor,
}
private:
+ inline v8::PersistentBase<v8::Value>* persistentForWrappable(
+ ScriptWrappable* wrappable) {
+ return &v8::Persistent<v8::Value>::Cast(*wrappable->rawMainWorldWrapper());
+ }
+
v8::HeapProfiler::RetainerChildren findV8WrappersDirectlyReachableFrom(
Node* traceable) {
CHECK(m_foundV8Wrappers.empty());
WTF::AutoReset<bool> scope(&m_onlyTraceSingleLevel, true);
m_firstScriptWrappableTraced = false;
- m_currentParent =
- &v8::Persistent<v8::Value>::Cast(*traceable->rawMainWorldWrapper());
+ m_currentParent = persistentForWrappable(traceable);
TracePrologue();
traceable->wrapperTypeInfo()->traceWrappers(this, traceable);
« 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