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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Visitor.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #ifndef Visitor_h 31 #ifndef Visitor_h
32 #define Visitor_h 32 #define Visitor_h
33 33
34 #include "platform/PlatformExport.h" 34 #include "platform/PlatformExport.h"
35 #include "platform/heap/GarbageCollected.h" 35 #include "platform/heap/GarbageCollected.h"
36 #include "wtf/Allocator.h" 36 #include "wtf/Allocator.h"
37 #include "wtf/Assertions.h" 37 #include "wtf/Assertions.h"
38 #include "wtf/Forward.h" 38 #include "wtf/Forward.h"
39 #include "wtf/HashTraits.h" 39 #include "wtf/HashTraits.h"
40 #include "wtf/TypeTraits.h" 40 #include "wtf/TypeTraits.h"
41 #include <memory>
42 41
43 namespace blink { 42 namespace blink {
44 43
45 template<typename T> class GarbageCollected; 44 template<typename T> class GarbageCollected;
46 class HeapObjectHeader; 45 class HeapObjectHeader;
47 class InlinedGlobalMarkingVisitor; 46 class InlinedGlobalMarkingVisitor;
48 template<typename T> class TraceTrait; 47 template<typename T> class TraceTrait;
49 template<typename T> class TraceEagerlyTrait; 48 template<typename T> class TraceEagerlyTrait;
50 class ThreadState; 49 class ThreadState;
51 class Visitor; 50 class Visitor;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // GCing thread. This is used for GCType=ThreadTerminationGC. 254 // GCing thread. This is used for GCType=ThreadTerminationGC.
256 ThreadLocalMarking, 255 ThreadLocalMarking,
257 // This visitor just marks objects and ignores weak processing. 256 // This visitor just marks objects and ignores weak processing.
258 // This is used for GCType=TakeSnapshot. 257 // This is used for GCType=TakeSnapshot.
259 SnapshotMarking, 258 SnapshotMarking,
260 // This visitor is used to trace objects during weak processing. 259 // This visitor is used to trace objects during weak processing.
261 // This visitor is allowed to trace only already marked objects. 260 // This visitor is allowed to trace only already marked objects.
262 WeakProcessing, 261 WeakProcessing,
263 }; 262 };
264 263
265 static std::unique_ptr<Visitor> create(ThreadState*, BlinkGC::GCType); 264 static PassOwnPtr<Visitor> create(ThreadState*, BlinkGC::GCType);
266 265
267 virtual ~Visitor(); 266 virtual ~Visitor();
268 267
269 using VisitorHelper<Visitor>::mark; 268 using VisitorHelper<Visitor>::mark;
270 269
271 // This method marks an object and adds it to the set of objects 270 // This method marks an object and adds it to the set of objects
272 // that should have their trace method called. Since not all 271 // that should have their trace method called. Since not all
273 // objects have vtables we have to have the callback as an 272 // objects have vtables we have to have the callback as an
274 // explicit argument, but we can use the templated one-argument 273 // explicit argument, but we can use the templated one-argument
275 // mark method above to automatically provide the callback 274 // mark method above to automatically provide the callback
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 private: 327 private:
329 static Visitor* fromHelper(VisitorHelper<Visitor>* helper) { return static_c ast<Visitor*>(helper); } 328 static Visitor* fromHelper(VisitorHelper<Visitor>* helper) { return static_c ast<Visitor*>(helper); }
330 329
331 ThreadState* m_state; 330 ThreadState* m_state;
332 const MarkingMode m_markingMode; 331 const MarkingMode m_markingMode;
333 }; 332 };
334 333
335 } // namespace blink 334 } // namespace blink
336 335
337 #endif // Visitor_h 336 #endif // Visitor_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.cpp ('k') | third_party/WebKit/Source/platform/heap/Visitor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698