Roll src/third_party/WebKit d10c917:a1123a1 (svn 198729:198730)
[chromium-blink-merge.git] / tools / clang / blink_gc_plugin / tests / destructor_eagerly_finalized.cpp
blob07409cc3ab36b48cbc905e5a78a7c7013608e38f
1 // Copyright 2015 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.
5 #include "destructor_eagerly_finalized.h"
7 namespace blink {
9 HeapObjectEagerFinalized::~HeapObjectEagerFinalized()
11 // Valid access to a non-eagerly finalized field
12 m_obj->foo();
15 void HeapObjectEagerFinalized::trace(Visitor* visitor)
17 visitor->trace(m_obj);
20 HeapObjectEagerFinalizedAlso::~HeapObjectEagerFinalizedAlso()
22 // Valid access to a non-eagerly finalized field
23 m_heapObject->foo();
25 // Non-valid accesses to eagerly finalized fields.
26 m_heapObjectFinalized->foo();
27 m_heapVector[0]->foo();
30 void HeapObjectEagerFinalizedAlso::trace(Visitor* visitor)
32 visitor->trace(m_heapObject);
33 visitor->trace(m_heapObjectFinalized);
34 visitor->trace(m_heapVector);
37 } // namespace blink