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

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

Issue 2556053004: [blink] Support moving timers between WebTaskRunners (Closed)
Patch Set: Address nits Created 4 years 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 | third_party/WebKit/Source/platform/Timer.cpp » ('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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 double nextFireInterval() const; 69 double nextFireInterval() const;
70 double repeatInterval() const { return m_repeatInterval; } 70 double repeatInterval() const { return m_repeatInterval; }
71 71
72 void augmentRepeatInterval(double delta) { 72 void augmentRepeatInterval(double delta) {
73 double now = timerMonotonicallyIncreasingTime(); 73 double now = timerMonotonicallyIncreasingTime();
74 setNextFireTime(now, std::max(m_nextFireTime - now + delta, 0.0)); 74 setNextFireTime(now, std::max(m_nextFireTime - now + delta, 0.0));
75 m_repeatInterval += delta; 75 m_repeatInterval += delta;
76 } 76 }
77 77
78 void moveToNewTaskRunner(WebTaskRunner*);
79
78 struct PLATFORM_EXPORT Comparator { 80 struct PLATFORM_EXPORT Comparator {
79 bool operator()(const TimerBase* a, const TimerBase* b) const; 81 bool operator()(const TimerBase* a, const TimerBase* b) const;
80 }; 82 };
81 83
82 protected: 84 protected:
83 static WebTaskRunner* getTimerTaskRunner(); 85 static WebTaskRunner* getTimerTaskRunner();
84 static WebTaskRunner* getUnthrottledTaskRunner(); 86 static WebTaskRunner* getUnthrottledTaskRunner();
85 87
86 private: 88 private:
87 virtual void fired() = 0; 89 virtual void fired() = 0;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 inline bool TimerBase::isActive() const { 200 inline bool TimerBase::isActive() const {
199 #if DCHECK_IS_ON() 201 #if DCHECK_IS_ON()
200 DCHECK_EQ(m_thread, currentThread()); 202 DCHECK_EQ(m_thread, currentThread());
201 #endif 203 #endif
202 return m_weakPtrFactory.hasWeakPtrs(); 204 return m_weakPtrFactory.hasWeakPtrs();
203 } 205 }
204 206
205 } // namespace blink 207 } // namespace blink
206 208
207 #endif // Timer_h 209 #endif // Timer_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/Timer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698