| OLD | NEW |
| 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 Loading... |
| 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::traceActiveScriptWrappables(ScriptWrappableVisitor*
visitor) |
| 43 { |
| 44 for (auto activeWrappable : activeScriptWrappables()) { |
| 45 if (!activeWrappable->hasPendingActivity()) |
| 46 continue; |
| 47 |
| 48 visitor->traceWrappers(activeWrappable->toScriptWrappable()); |
| 49 } |
| 50 } |
| 51 |
| 41 } // namespace blink | 52 } // namespace blink |
| OLD | NEW |