| Index: third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..32bd0eeb8dadd5333286a69f39cbf80e70dea5a7
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp
|
| @@ -0,0 +1,60 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "bindings/core/v8/ScriptWrappableVisitor.h"
|
| +
|
| +#include "bindings/core/v8/ScriptWrappable.h"
|
| +#include "bindings/core/v8/ScriptWrappableHeapTracer.h"
|
| +#include "core/dom/NodeRareData.h"
|
| +#include "core/events/EventListenerMap.h"
|
| +#include "core/events/EventTarget.h"
|
| +#include "platform/heap/HeapPage.h"
|
| +
|
| +namespace blink {
|
| +
|
| +bool ScriptWrappableVisitor::isVisited(const void* garbageCollected) const
|
| +{
|
| + return HeapObjectHeader::fromPayload(garbageCollected)->isDOMMarked();
|
| +}
|
| +
|
| +void ScriptWrappableVisitor::visit(const ScriptWrappable* scriptWrappable) const
|
| +{
|
| + HeapObjectHeader* header = HeapObjectHeader::fromPayload(scriptWrappable);
|
| + header->markDOM();
|
| + m_tracer->AddHeaderToUnmark(header);
|
| +
|
| + if (scriptWrappable->containsWrapper())
|
| + scriptWrappable->markWrapperAlive(m_isolate);
|
| +}
|
| +
|
| +void ScriptWrappableVisitor::visit(const void* garbageCollected) const
|
| +{
|
| + HeapObjectHeader* header = HeapObjectHeader::fromPayload(garbageCollected);
|
| + header->markDOM();
|
| + m_tracer->AddHeaderToUnmark(header);
|
| +}
|
| +
|
| +void ScriptWrappableVisitor::visitHandle(v8::Persistent<v8::Object>& handle) const
|
| +{
|
| + ScriptWrappable::markWrapperAlive(handle, m_isolate);
|
| +}
|
| +
|
| +void ScriptWrappableVisitor::accept(const ScriptWrappable* wrappable) const
|
| +{
|
| + if (wrappable)
|
| + wrappable->traceWrappable(this);
|
| +}
|
| +
|
| +void ScriptWrappableVisitor::accept(const ScriptWrappable& wrappable) const
|
| +{
|
| + accept(&wrappable);
|
| +}
|
| +
|
| +void ScriptWrappableVisitor::accept(const NodeRareData* data) const
|
| +{
|
| + if (data)
|
| + data->traceWrappable(this);
|
| +}
|
| +
|
| +} // namespace blink
|
|
|