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

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

Issue 1909813002: Enable per thread heap for database thread (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
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // The strongification of collections relies on the fact that once a 198 // The strongification of collections relies on the fact that once a
199 // collection has been strongified, there is no way that it can contain 199 // collection has been strongified, there is no way that it can contain
200 // non-live entries, so no entries will be removed. Since you can't set 200 // non-live entries, so no entries will be removed. Since you can't set
201 // the mark bit on a null pointer, that means that null pointers are 201 // the mark bit on a null pointer, that means that null pointers are
202 // always 'alive'. 202 // always 'alive'.
203 if (!object) 203 if (!object)
204 return true; 204 return true;
205 // TODO(keishi): some tests create CrossThreadPersistent on non attached threads. 205 // TODO(keishi): some tests create CrossThreadPersistent on non attached threads.
206 if (!ThreadState::current()) 206 if (!ThreadState::current())
207 return true; 207 return true;
208 DCHECK(&ThreadState::current()->heap() == &pageFromObject(object)->arena ()->getThreadState()->heap()); 208 if (&ThreadState::current()->heap() == &pageFromObject(object)->arena()- >getThreadState()->heap())
keishi 2016/06/02 02:01:02 During the code review, I changed this to a DCHECK
haraken 2016/06/02 02:23:31 I don't quite understand why you want to unconditi
keishi 2016/06/02 02:58:53 Sorry forgot to flip the expression. Cross thread
209 return true;
209 return ObjectAliveTrait<T>::isHeapObjectAlive(object); 210 return ObjectAliveTrait<T>::isHeapObjectAlive(object);
210 } 211 }
211 template<typename T> 212 template<typename T>
212 static inline bool isHeapObjectAlive(const Member<T>& member) 213 static inline bool isHeapObjectAlive(const Member<T>& member)
213 { 214 {
214 return isHeapObjectAlive(member.get()); 215 return isHeapObjectAlive(member.get());
215 } 216 }
216 template<typename T> 217 template<typename T>
217 static inline bool isHeapObjectAlive(const WeakMember<T>& member) 218 static inline bool isHeapObjectAlive(const WeakMember<T>& member)
218 { 219 {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) 621 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object)
621 { 622 {
622 T** cell = reinterpret_cast<T**>(object); 623 T** cell = reinterpret_cast<T**>(object);
623 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 624 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
624 *cell = nullptr; 625 *cell = nullptr;
625 } 626 }
626 627
627 } // namespace blink 628 } // namespace blink
628 629
629 #endif // Heap_h 630 #endif // Heap_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698