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

Side by Side Diff: Source/core/workers/WorkerThread.h

Issue 1134523002: Implement timers by posting delayed tasks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Gyp tweak. 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 30 matching lines...) Expand all
41 #include "wtf/RefCounted.h" 41 #include "wtf/RefCounted.h"
42 #include <v8.h> 42 #include <v8.h>
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class WebWaitableEvent; 46 class WebWaitableEvent;
47 class WorkerGlobalScope; 47 class WorkerGlobalScope;
48 class WorkerInspectorController; 48 class WorkerInspectorController;
49 class WorkerMicrotaskRunner; 49 class WorkerMicrotaskRunner;
50 class WorkerReportingProxy; 50 class WorkerReportingProxy;
51 class WorkerSharedTimer;
52 class WorkerThreadStartupData; 51 class WorkerThreadStartupData;
53 class WorkerThreadTask; 52 class WorkerThreadTask;
54 53
55 enum WorkerThreadStartMode { 54 enum WorkerThreadStartMode {
56 DontPauseWorkerGlobalScopeOnStart, 55 DontPauseWorkerGlobalScopeOnStart,
57 PauseWorkerGlobalScopeOnStart 56 PauseWorkerGlobalScopeOnStart
58 }; 57 };
59 58
60 // TODO(sadrul): Rename to WorkerScript. 59 // TODO(sadrul): Rename to WorkerScript.
61 class CORE_EXPORT WorkerThread : public RefCounted<WorkerThread> { 60 class CORE_EXPORT WorkerThread : public RefCounted<WorkerThread> {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 124
126 virtual v8::Isolate* initializeIsolate(); 125 virtual v8::Isolate* initializeIsolate();
127 virtual void willDestroyIsolate(); 126 virtual void willDestroyIsolate();
128 virtual void destroyIsolate(); 127 virtual void destroyIsolate();
129 virtual void terminateV8Execution(); 128 virtual void terminateV8Execution();
130 129
131 // This is protected virtual for testing. 130 // This is protected virtual for testing.
132 virtual bool doIdleGc(double deadlineSeconds); 131 virtual bool doIdleGc(double deadlineSeconds);
133 132
134 private: 133 private:
135 friend class WorkerSharedTimer;
136 friend class WorkerThreadIdleTask; 134 friend class WorkerThreadIdleTask;
137 friend class WorkerMicrotaskRunner; 135 friend class WorkerMicrotaskRunner;
138 136
139 void stopInShutdownSequence(); 137 void stopInShutdownSequence();
140 void stopInternal(); 138 void stopInternal();
141 139
142 void initialize(); 140 void initialize();
143 void shutdown(); 141 void shutdown();
144 void performIdleWork(double deadlineSeconds); 142 void performIdleWork(double deadlineSeconds);
145 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs); 143 void postDelayedTask(PassOwnPtr<ExecutionContextTask>, long long delayMs);
(...skipping 23 matching lines...) Expand all
169 // Used to signal thread shutdown. 167 // Used to signal thread shutdown.
170 OwnPtr<WebWaitableEvent> m_shutdownEvent; 168 OwnPtr<WebWaitableEvent> m_shutdownEvent;
171 169
172 // Used to signal thread termination. 170 // Used to signal thread termination.
173 OwnPtr<WebWaitableEvent> m_terminationEvent; 171 OwnPtr<WebWaitableEvent> m_terminationEvent;
174 }; 172 };
175 173
176 } // namespace blink 174 } // namespace blink
177 175
178 #endif // WorkerThread_h 176 #endif // WorkerThread_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698