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

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

Issue 2050463003: Check if Member owner thread matches pointer thread and current thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return reinterpret_cast<ThreadState*>(s_mainThreadStateStorage); 217 return reinterpret_cast<ThreadState*>(s_mainThreadStateStorage);
218 } 218 }
219 219
220 static ThreadState* fromObject(const void*); 220 static ThreadState* fromObject(const void*);
221 221
222 bool isMainThread() const { return this == mainThreadState(); } 222 bool isMainThread() const { return this == mainThreadState(); }
223 #if ENABLE(ASSERT) 223 #if ENABLE(ASSERT)
224 bool checkThread() const { return m_thread == currentThread(); } 224 bool checkThread() const { return m_thread == currentThread(); }
225 #endif 225 #endif
226 226
227 ThreadHeap& heap() { return *m_heap; } 227 ThreadHeap& heap() const { return *m_heap; }
228 228
229 // When ThreadState is detaching from non-main thread its 229 // When ThreadState is detaching from non-main thread its
230 // heap is expected to be empty (because it is going away). 230 // heap is expected to be empty (because it is going away).
231 // Perform registered cleanup tasks and garbage collection 231 // Perform registered cleanup tasks and garbage collection
232 // to sweep away any objects that are left on this heap. 232 // to sweep away any objects that are left on this heap.
233 // We assert that nothing must remain after this cleanup. 233 // We assert that nothing must remain after this cleanup.
234 // If assertion does not hold we crash as we are potentially 234 // If assertion does not hold we crash as we are potentially
235 // in the dangling pointer situation. 235 // in the dangling pointer situation.
236 void runTerminationGC(); 236 void runTerminationGC();
237 237
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 706
707 template<> class ThreadStateFor<AnyThread> { 707 template<> class ThreadStateFor<AnyThread> {
708 STATIC_ONLY(ThreadStateFor); 708 STATIC_ONLY(ThreadStateFor);
709 public: 709 public:
710 static ThreadState* state() { return ThreadState::current(); } 710 static ThreadState* state() { return ThreadState::current(); }
711 }; 711 };
712 712
713 } // namespace blink 713 } // namespace blink
714 714
715 #endif // ThreadState_h 715 #endif // ThreadState_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Member.h ('k') | third_party/WebKit/Source/platform/heap/WrapperVisitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698