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

Side by Side Diff: tools/clang/blink_gc_plugin/tests/fields_illegal_tracing.h

Issue 2060553002: GC plugin: improve error reporting when tracing illegal fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: robustify namespace equality checking instead Created 4 years, 6 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 #ifndef FIELDS_ILLEGAL_TRACING_H_
6 #define FIELDS_ILLEGAL_TRACING_H_
7
8 #include "heap/stubs.h"
9
10 namespace blink {
11
12 namespace bar {
13
14 // check that (only) std::unique_ptr<> is reported
15 // as an illegal smart pointer type.
16 template<typename T> class unique_ptr {
17 public:
18 ~unique_ptr() { }
19 operator T*() const { return 0; }
20 T* operator->() { return 0; }
21
22 void trace(Visitor* visitor)
23 {
24 }
25 };
26
27 }
28
29 class HeapObject;
30 class PartObject;
31
32 class PartObject {
33 DISALLOW_ALLOCATION();
34 public:
35 void trace(Visitor*);
36 private:
37 OwnPtr<HeapObject> m_obj1;
38 RefPtr<HeapObject> m_obj2;
39 bar::unique_ptr<HeapObject> m_obj3;
40 std::unique_ptr<HeapObject> m_obj4;
41 };
42
43 class HeapObject : public GarbageCollectedFinalized<HeapObject> {
44 public:
45 void trace(Visitor*);
46 private:
47 PartObject m_part;
48 OwnPtr<HeapObject> m_obj1;
49 RefPtr<HeapObject> m_obj2;
50 bar::unique_ptr<HeapObject> m_obj3;
51 std::unique_ptr<HeapObject> m_obj4;
52 };
53
54 }
55
56 #endif
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/TracingStatus.h ('k') | tools/clang/blink_gc_plugin/tests/fields_illegal_tracing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698