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

Side by Side Diff: Source/platform/heap/Handle.h

Issue 371623002: [oilpan]: Make thread shutdown more robust. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review feedback Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | Source/platform/heap/Heap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // A dummy Persistent handle that ensures the list of persistents is never null. 229 // A dummy Persistent handle that ensures the list of persistents is never null.
230 // This removes a test from a hot path. 230 // This removes a test from a hot path.
231 class PersistentAnchor : public PersistentNode { 231 class PersistentAnchor : public PersistentNode {
232 public: 232 public:
233 void trace(Visitor* visitor) 233 void trace(Visitor* visitor)
234 { 234 {
235 for (PersistentNode* current = m_next; current != this; current = curren t->m_next) 235 for (PersistentNode* current = m_next; current != this; current = curren t->m_next)
236 current->trace(visitor); 236 current->trace(visitor);
237 } 237 }
238 238
239 int numberOfPersistents()
240 {
241 int numberOfPersistents = 0;
242 for (PersistentNode* current = m_next; current != this; current = curren t->m_next)
243 ++numberOfPersistents;
244 return numberOfPersistents;
245 }
246
239 virtual ~PersistentAnchor() 247 virtual ~PersistentAnchor()
240 { 248 {
241 // FIXME: oilpan: Ideally we should have no left-over persistents at thi s point. However currently there is a 249 // FIXME: oilpan: Ideally we should have no left-over persistents at thi s point. However currently there is a
242 // large number of objects leaked when we tear down the main thread. Sin ce some of these might contain a 250 // large number of objects leaked when we tear down the main thread. Sin ce some of these might contain a
243 // persistent or e.g. be RefCountedGarbageCollected we cannot guarantee there are no remaining Persistents at 251 // persistent or e.g. be RefCountedGarbageCollected we cannot guarantee there are no remaining Persistents at
244 // this point. 252 // this point.
245 } 253 }
246 254
247 private: 255 private:
248 PersistentAnchor() : PersistentNode(TraceMethodDelegate<PersistentAnchor, &P ersistentAnchor::trace>::trampoline) 256 PersistentAnchor() : PersistentNode(TraceMethodDelegate<PersistentAnchor, &P ersistentAnchor::trace>::trampoline)
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, WebCore::Is GarbageCollectedType<T>::value> { 1169 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, WebCore::Is GarbageCollectedType<T>::value> {
1162 }; 1170 };
1163 1171
1164 template<typename T> 1172 template<typename T>
1165 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, Web Core::IsGarbageCollectedType<T>::value> { 1173 struct ParamStorageTraits<RawPtr<T> > : public PointerParamStorageTraits<T*, Web Core::IsGarbageCollectedType<T>::value> {
1166 }; 1174 };
1167 1175
1168 } // namespace WTF 1176 } // namespace WTF
1169 1177
1170 #endif 1178 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | Source/platform/heap/Heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698