Chromium Code Reviews| 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); |