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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ActiveScriptWrappable.cpp

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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 unified diff | Download patch
OLDNEW
(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/ActiveScriptWrappable.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 using ActiveScriptWrappableSetType = HashSet<const ActiveScriptWrappable*>;
16
17 ActiveScriptWrappableSetType& activeScriptWrappables()
18 {
19 DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<ActiveScriptWrappableSetType> , activeScriptWrappableSet, new ThreadSpecific<ActiveScriptWrappableSetType>());
20 return *activeScriptWrappableSet;
21 }
22
23 } // namespace
24
25 ActiveScriptWrappable::ActiveScriptWrappable(ScriptWrappable* self)
26 : m_scriptWrappable(self)
27 {
28 activeScriptWrappables().add(this);
29 }
30
31 ActiveScriptWrappable::~ActiveScriptWrappable()
sof 2016/05/10 05:22:26 haraken@: is it guaranteed that this global set of
32 {
33 activeScriptWrappables().remove(this);
34 }
35
36 ScriptWrappable* ActiveScriptWrappable::toScriptWrappable() const
37 {
38 return m_scriptWrappable;
39 }
40
41 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698