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

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

Issue 1120943002: Various ASan exemptions to allow Oilpan pre-sweep poisoning of unmarkeds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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) 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void augmentRepeatInterval(double delta) { 65 void augmentRepeatInterval(double delta) {
66 setNextFireTime(m_nextFireTime + delta); 66 setNextFireTime(m_nextFireTime + delta);
67 m_repeatInterval += delta; 67 m_repeatInterval += delta;
68 } 68 }
69 69
70 void didChangeAlignmentInterval(); 70 void didChangeAlignmentInterval();
71 71
72 private: 72 private:
73 virtual void fired() = 0; 73 virtual void fired() = 0;
74 74
75 NO_SANITIZE_ADDRESS
75 virtual double alignedFireTime(double fireTime) const { return fireTime; } 76 virtual double alignedFireTime(double fireTime) const { return fireTime; }
76 77
77 void checkConsistency() const; 78 void checkConsistency() const;
78 void checkHeapIndex() const; 79 void checkHeapIndex() const;
79 80
80 void setNextFireTime(double); 81 void setNextFireTime(double);
81 82
83 NO_SANITIZE_ADDRESS
82 bool inHeap() const { return m_heapIndex != -1; } 84 bool inHeap() const { return m_heapIndex != -1; }
83 85
84 bool hasValidHeapPosition() const; 86 bool hasValidHeapPosition() const;
85 void updateHeapIfNeeded(double oldTime); 87 void updateHeapIfNeeded(double oldTime);
86 88
87 void heapDecreaseKey(); 89 void heapDecreaseKey();
88 void heapDelete(); 90 void heapDelete();
89 void heapDeleteMin(); 91 void heapDeleteMin();
90 void heapIncreaseKey(); 92 void heapIncreaseKey();
91 void heapInsert(); 93 void heapInsert();
92 void heapPop(); 94 void heapPop();
93 void heapPopMin(); 95 void heapPopMin();
94 96
97 NO_SANITIZE_ADDRESS
95 Vector<TimerBase*>& timerHeap() const { ASSERT(m_cachedThreadGlobalTimerHeap ); return *m_cachedThreadGlobalTimerHeap; } 98 Vector<TimerBase*>& timerHeap() const { ASSERT(m_cachedThreadGlobalTimerHeap ); return *m_cachedThreadGlobalTimerHeap; }
96 99
97 double m_nextFireTime; // 0 if inactive 100 double m_nextFireTime; // 0 if inactive
98 double m_unalignedNextFireTime; // m_nextFireTime not considering alignment interval 101 double m_unalignedNextFireTime; // m_nextFireTime not considering alignment interval
99 double m_repeatInterval; // 0 if not repeating 102 double m_repeatInterval; // 0 if not repeating
100 int m_heapIndex; // -1 if not in heap 103 int m_heapIndex; // -1 if not in heap
101 unsigned m_heapInsertionOrder; // Used to keep order among equal-fire-time t imers 104 unsigned m_heapInsertionOrder; // Used to keep order among equal-fire-time t imers
102 Vector<TimerBase*>* m_cachedThreadGlobalTimerHeap; 105 Vector<TimerBase*>* m_cachedThreadGlobalTimerHeap;
103 WebTraceLocation m_location; 106 WebTraceLocation m_location;
104 107
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 150
148 private: 151 private:
149 // FIXME: oilpan: TimerBase should be moved to the heap and m_object should be traced. 152 // FIXME: oilpan: TimerBase should be moved to the heap and m_object should be traced.
150 // This raw pointer is safe as long as Timer<X> is held by the X itself (Tha t's the case 153 // This raw pointer is safe as long as Timer<X> is held by the X itself (Tha t's the case
151 // in the current code base). 154 // in the current code base).
152 GC_PLUGIN_IGNORE("363031") 155 GC_PLUGIN_IGNORE("363031")
153 TimerFiredClass* m_object; 156 TimerFiredClass* m_object;
154 TimerFiredFunction m_function; 157 TimerFiredFunction m_function;
155 }; 158 };
156 159
160 NO_SANITIZE_ADDRESS
157 inline bool TimerBase::isActive() const 161 inline bool TimerBase::isActive() const
158 { 162 {
159 ASSERT(m_thread == currentThread()); 163 ASSERT(m_thread == currentThread());
160 return m_nextFireTime; 164 return m_nextFireTime;
161 } 165 }
162 166
163 } 167 }
164 168
165 #endif 169 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698