Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ScriptWrappableHeapTracer_h | |
| 6 #define ScriptWrappableHeapTracer_h | |
| 7 | |
| 8 #include <v8.h> | |
| 9 #include <vector> | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class HeapObjectHeader; | |
| 14 | |
| 15 /** | |
| 16 * When this heap tracer is set to the v8::Isolate, the V8 will call it during | |
| 17 * its garbage collection. At the beginning, it will call TraceRoots, then | |
| 18 * repeatedly (as v8 discovers more wrappers) it will call TraceWrappableFrom, | |
| 19 * and at the end it will call ClearTracingMarks. | |
| 20 */ | |
| 21 class ScriptWrappableHeapTracer : public v8::EmbedderHeapTracer { | |
| 22 public: | |
| 23 ~ScriptWrappableHeapTracer() override; | |
| 24 void TraceRoots(v8::Isolate*) override; | |
| 25 void TraceWrappableFrom(v8::Isolate*, const std::vector<std::pair<void*, voi d*>>& hiddenFieldsOfPotentialWrappers) override; | |
| 26 void TraceWrappableFrom(v8::Isolate*, v8::Persistent<v8::Object>* wrapper); | |
| 27 void AddHeaderToUnmark(HeapObjectHeader*); | |
| 28 void ClearTracingMarks(v8::Isolate*) override; | |
| 29 private: | |
| 30 void TraceWrappableFrom(v8::Isolate*, std::pair<void*, void*> hiddenFields); | |
| 31 bool m_tracingInProgress = false; | |
| 32 std::vector<HeapObjectHeader*> m_headersToUnmark; | |
|
haraken
2016/04/13 12:26:22
How is it guaranteed that Oilpan's GC does not hap
Marcel Hlopko
2016/04/14 16:39:08
Currently, there are no guarantees that oilpan gc
haraken
2016/04/15 01:28:16
Ah, good point. You're right.
Marcel Hlopko
2016/04/15 07:27:15
Sad, I was hoping the DOMArrayBuffer and DOMArrayB
| |
| 33 }; | |
| 34 | |
| 35 } // namespace blink | |
| 36 | |
| 37 #endif // ScriptWrappableHeapTracer_h | |
| OLD | NEW |