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

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

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate Haraken's wonderful comments Created 4 years, 8 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/ActiveScriptWrappable.h" 5 #include "bindings/core/v8/ActiveScriptWrappable.h"
6 6
7 #include "bindings/core/v8/ScriptWrappable.h"
7 #include "wtf/HashSet.h" 8 #include "wtf/HashSet.h"
8 #include "wtf/ThreadSpecific.h" 9 #include "wtf/ThreadSpecific.h"
9 #include "wtf/Threading.h" 10 #include "wtf/Threading.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 namespace { 14 namespace {
14 15
15 using ActiveScriptWrappableSetType = HashSet<const ActiveScriptWrappable*>; 16 using ActiveScriptWrappableSetType = HashSet<const ActiveScriptWrappable*>;
16 17
(...skipping 14 matching lines...) Expand all
31 ActiveScriptWrappable::~ActiveScriptWrappable() 32 ActiveScriptWrappable::~ActiveScriptWrappable()
32 { 33 {
33 activeScriptWrappables().remove(this); 34 activeScriptWrappables().remove(this);
34 } 35 }
35 36
36 ScriptWrappable* ActiveScriptWrappable::toScriptWrappable() const 37 ScriptWrappable* ActiveScriptWrappable::toScriptWrappable() const
37 { 38 {
38 return m_scriptWrappable; 39 return m_scriptWrappable;
39 } 40 }
40 41
42 void ActiveScriptWrappable::traceActiveWrappable(ScriptWrappableVisitor* visitor )
haraken 2016/04/13 12:26:22 traceActiveWrappable => traceWrappers ? (I want t
Marcel Hlopko 2016/04/14 16:39:08 Done.
43 {
44 for (auto activeWrappable : activeScriptWrappables()) {
45 if (!activeWrappable->hasPendingActivity())
46 continue;
47
48 visitor->trace(activeWrappable->toScriptWrappable());
49 }
50 }
51
41 } // namespace blink 52 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698