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

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

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored Created 4 years, 10 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CallbackStack_h 5 #ifndef CallbackStack_h
6 #define CallbackStack_h 6 #define CallbackStack_h
7 7
8 #include "platform/heap/ThreadState.h" 8 #include "platform/heap/ThreadState.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // The CallbackStack contains all the visitor callbacks used to trace and mark 13 // The CallbackStack contains all the visitor callbacks used to trace and mark
14 // objects. A specific CallbackStack instance contains at most bufferSize elemen ts. 14 // objects. A specific CallbackStack instance contains at most bufferSize elemen ts.
15 // If more space is needed a new CallbackStack instance is created and chained 15 // If more space is needed a new CallbackStack instance is created and chained
16 // together with the former instance. I.e. a logical CallbackStack can be made o f 16 // together with the former instance. I.e. a logical CallbackStack can be made o f
17 // multiple chained CallbackStack object instances. 17 // multiple chained CallbackStack object instances.
18 class CallbackStack { 18 class PLATFORM_EXPORT CallbackStack {
19 public: 19 public:
20 class Item { 20 class Item {
21 public: 21 public:
22 Item() { } 22 Item() { }
23 Item(void* object, VisitorCallback callback) 23 Item(void* object, VisitorCallback callback)
24 : m_object(object) 24 : m_object(object)
25 , m_callback(callback) 25 , m_callback(callback)
26 { 26 {
27 } 27 }
28 void* object() { return m_object; } 28 void* object() { return m_object; }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 Item* item = m_first->pop(); 134 Item* item = m_first->pop();
135 if (LIKELY(!!item)) 135 if (LIKELY(!!item))
136 return item; 136 return item;
137 137
138 return popSlow(); 138 return popSlow();
139 } 139 }
140 140
141 } // namespace blink 141 } // namespace blink
142 142
143 #endif // CallbackStack_h 143 #endif // CallbackStack_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698