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

Unified Diff: Source/platform/ThreadTimers.h

Issue 1162753003: Revert "Implement timers by posting delayed tasks" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/SharedTimer.cpp ('k') | Source/platform/ThreadTimers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/ThreadTimers.h
diff --git a/Source/platform/ContentType.h b/Source/platform/ThreadTimers.h
similarity index 61%
copy from Source/platform/ContentType.h
copy to Source/platform/ThreadTimers.h
index f67d4e2ca33917068892ea5f6d342cba960a65e3..031f4a7c15f43fa65ef13cecd1ee751d70d90b3c 100644
--- a/Source/platform/ContentType.h
+++ b/Source/platform/ThreadTimers.h
@@ -24,26 +24,44 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ContentType_h
-#define ContentType_h
+#ifndef ThreadTimers_h
+#define ThreadTimers_h
#include "platform/PlatformExport.h"
-#include "wtf/text/WTFString.h"
+#include "platform/SharedTimer.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/HashSet.h"
+#include "wtf/Vector.h"
namespace blink {
-class PLATFORM_EXPORT ContentType {
+class TimerBase;
+
+// A collection of timers per thread. Kept in PlatformThreadData.
+class PLATFORM_EXPORT ThreadTimers {
+ WTF_MAKE_NONCOPYABLE(ThreadTimers); WTF_MAKE_FAST_ALLOCATED(ThreadTimers);
public:
- explicit ContentType(const String& type);
+ ThreadTimers();
+
+ // On a thread different then main, we should set the thread's instance of the SharedTimer.
+ void setSharedTimer(WTF::PassOwnPtr<SharedTimer>);
+
+ Vector<TimerBase*>& timerHeap() { return m_timerHeap; }
+
+ void updateSharedTimer();
+ double nextFireTime() const { return m_pendingSharedTimerFireTime; }
- String parameter(const String& parameterName) const;
- String type() const;
- Vector<String> codecs() const;
- const String& raw() const { return m_type; }
private:
- String m_type;
+ static void sharedTimerFired();
+
+ void sharedTimerFiredInternal();
+
+ Vector<TimerBase*> m_timerHeap;
+ OwnPtr<SharedTimer> m_sharedTimer;
+ bool m_firingTimers; // Reentrancy guard.
+ double m_pendingSharedTimerFireTime;
};
-} // namespace blink
+}
-#endif // ContentType_h
+#endif
« no previous file with comments | « Source/platform/SharedTimer.cpp ('k') | Source/platform/ThreadTimers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698