| 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
|
|
|