 Chromium Code Reviews
 Chromium Code Reviews Issue 2625093002:
  [wrapper-tracing] Add heap snapshot generator infrastructure  (Closed)
    
  
    Issue 2625093002:
  [wrapper-tracing] Add heap snapshot generator infrastructure  (Closed) 
  | Index: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp | 
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp | 
| index e6e7ce8ed3835089017642f63ae9bedf72b2b30e..ccaebaffbcb8c9fd680a7d28b725a2fe65123411 100644 | 
| --- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp | 
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp | 
| @@ -397,4 +397,14 @@ void V8PerIsolateData::addActiveScriptWrappable( | 
| m_activeScriptWrappables->add(wrappable); | 
| } | 
| +void V8PerIsolateData::TemporaryScriptWrappableVisitorScope::setVisitor( | 
| + ScriptWrappableVisitor* visitor) { | 
| + ScriptWrappableVisitor* current = currentVisitor(m_isolate); | 
| + if (current) | 
| + current->performCleanup(); | 
| 
haraken
2017/01/16 02:46:56
Would you elaborate on why it's okay to call perfo
 
Michael Lippautz
2017/01/16 10:45:06
We can only swap tracers when tracing is not yet s
 
haraken
2017/01/17 00:31:25
How is it guaranteed that V8GCController::getRetai
 
Michael Lippautz
2017/01/17 09:15:32
Yes, V8 guarantees that.
 | 
| + V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.release(); | 
| 
haraken
2017/01/16 02:46:56
Ah, you need .release() because you need to leak t
 
Michael Lippautz
2017/01/16 10:45:06
Ah, now I understand, thanks! Done.
 | 
| + V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.reset(visitor); | 
| + m_isolate->SetEmbedderHeapTracer(visitor); | 
| +} | 
| + | 
| } // namespace blink |