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 #include "bindings/core/v8/V8GCRoot.h" | |
| 6 | |
| 7 #include "wtf/HashSet.h" | |
| 8 #include "wtf/ThreadSpecific.h" | |
| 9 #include "wtf/Threading.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 namespace { | |
| 14 | |
| 15 HashSet<V8GCRoot*>& gcRoots() | |
| 16 { | |
| 17 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<HashSet<V8GCRoot*>>, gcRootSe t, new ThreadSpecific<HashSet<V8GCRoot*>>()); | |
| 18 return *gcRootSet; | |
| 19 } | |
| 20 | |
| 21 } // namespace | |
| 22 | |
| 23 V8GCRoot::V8GCRoot() | |
| 24 { | |
| 25 gcRoots().add(this); | |
|
jochen (gone - plz use gerrit)
2016/03/16 08:46:38
we might have to add a ScriptWrappable* parameter
Marcel Hlopko
2016/03/16 09:07:40
I will certainly need a way to get to the ScriptWr
| |
| 26 } | |
| 27 | |
| 28 V8GCRoot::~V8GCRoot() | |
| 29 { | |
| 30 gcRoots().remove(this); | |
| 31 } | |
| 32 | |
| 33 } // namespace blink | |
| OLD | NEW |