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

Unified Diff: Source/platform/PlatformThreadData.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/core/workers/WorkerThread.cpp ('k') | Source/platform/PlatformThreadData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/PlatformThreadData.h
diff --git a/Source/platform/Task.h b/Source/platform/PlatformThreadData.h
similarity index 77%
copy from Source/platform/Task.h
copy to Source/platform/PlatformThreadData.h
index b4fbafb9ed7c37e0e609da56e261d41e21fa3172..428da4b9e48b3a393b82d2835918fbe5508c6ef7 100644
--- a/Source/platform/Task.h
+++ b/Source/platform/PlatformThreadData.h
@@ -28,32 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Task_h
-#define Task_h
+#ifndef PlatformThreadData_h
+#define PlatformThreadData_h
-#include "public/platform/WebThread.h"
-#include "wtf/Functional.h"
+#include "platform/PlatformExport.h"
+#include "wtf/Noncopyable.h"
#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
namespace blink {
-class Task : public WebThread::Task {
+class ThreadTimers;
+
+class PLATFORM_EXPORT PlatformThreadData {
+ WTF_MAKE_NONCOPYABLE(PlatformThreadData);
public:
- explicit Task(PassOwnPtr<Closure> closure)
- : m_closure(closure)
- {
- }
+ PlatformThreadData();
+ ~PlatformThreadData();
+
+ ThreadTimers& threadTimers() { return *m_threadTimers; }
- virtual void run() override
- {
- (*m_closure)();
- }
+ static PlatformThreadData& current();
+ void destroy();
private:
- OwnPtr<Closure> m_closure;
+ OwnPtr<ThreadTimers> m_threadTimers;
};
} // namespace blink
-#endif // Task_h
+#endif // PlatformThreadData_h
« no previous file with comments | « Source/core/workers/WorkerThread.cpp ('k') | Source/platform/PlatformThreadData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698