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

Side by Side Diff: Source/platform/Timer.h

Issue 858363005: Oilpan: expose near-finalized predicate as Heap::willObjectBeLazilySwept() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: assert for valid object reference Created 5 years, 11 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 | « no previous file | Source/platform/heap/Heap.h » ('j') | 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) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 }; 120 };
121 121
122 template<typename T> 122 template<typename T>
123 class TimerIsObjectAliveTrait<T, true> { 123 class TimerIsObjectAliveTrait<T, true> {
124 public: 124 public:
125 static bool isAlive(T* objectPointer) 125 static bool isAlive(T* objectPointer)
126 { 126 {
127 // Oilpan: if a timer fires while Oilpan heaps are being lazily 127 // Oilpan: if a timer fires while Oilpan heaps are being lazily
128 // swept, it is not safe to proceed if the object is about to 128 // swept, it is not safe to proceed if the object is about to
129 // be swept (and this timer will be stopped while doing so.) 129 // be swept (and this timer will be stopped while doing so.)
130 return Heap::isFinalizedObjectAlive(objectPointer); 130 return !Heap::willObjectBeLazilySwept(objectPointer);
131 } 131 }
132 }; 132 };
133 133
134 template <typename TimerFiredClass> 134 template <typename TimerFiredClass>
135 class Timer final : public TimerBase { 135 class Timer final : public TimerBase {
136 public: 136 public:
137 typedef void (TimerFiredClass::*TimerFiredFunction)(Timer*); 137 typedef void (TimerFiredClass::*TimerFiredFunction)(Timer*);
138 138
139 Timer(TimerFiredClass* o, TimerFiredFunction f) 139 Timer(TimerFiredClass* o, TimerFiredFunction f)
140 : m_object(o), m_function(f) { } 140 : m_object(o), m_function(f) { }
(...skipping 16 matching lines...) Expand all
157 157
158 inline bool TimerBase::isActive() const 158 inline bool TimerBase::isActive() const
159 { 159 {
160 ASSERT(m_thread == currentThread()); 160 ASSERT(m_thread == currentThread());
161 return m_nextFireTime; 161 return m_nextFireTime;
162 } 162 }
163 163
164 } 164 }
165 165
166 #endif 166 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698