OLD | NEW |
---|---|
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 20 matching lines...) Expand all Loading... | |
31 #include "bindings/core/v8/ScriptSourceCode.h" | 31 #include "bindings/core/v8/ScriptSourceCode.h" |
32 #include "bindings/core/v8/V8GCController.h" | 32 #include "bindings/core/v8/V8GCController.h" |
33 #include "bindings/core/v8/V8Initializer.h" | 33 #include "bindings/core/v8/V8Initializer.h" |
34 #include "core/dom/Microtask.h" | 34 #include "core/dom/Microtask.h" |
35 #include "core/inspector/InspectorInstrumentation.h" | 35 #include "core/inspector/InspectorInstrumentation.h" |
36 #include "core/inspector/WorkerInspectorController.h" | 36 #include "core/inspector/WorkerInspectorController.h" |
37 #include "core/workers/DedicatedWorkerGlobalScope.h" | 37 #include "core/workers/DedicatedWorkerGlobalScope.h" |
38 #include "core/workers/WorkerClients.h" | 38 #include "core/workers/WorkerClients.h" |
39 #include "core/workers/WorkerReportingProxy.h" | 39 #include "core/workers/WorkerReportingProxy.h" |
40 #include "core/workers/WorkerThreadStartupData.h" | 40 #include "core/workers/WorkerThreadStartupData.h" |
41 #include "platform/PlatformThreadData.h" | |
42 #include "platform/Task.h" | 41 #include "platform/Task.h" |
43 #include "platform/ThreadTimers.h" | |
44 #include "platform/heap/SafePoint.h" | 42 #include "platform/heap/SafePoint.h" |
45 #include "platform/heap/ThreadState.h" | 43 #include "platform/heap/ThreadState.h" |
46 #include "platform/weborigin/KURL.h" | 44 #include "platform/weborigin/KURL.h" |
47 #include "public/platform/Platform.h" | 45 #include "public/platform/Platform.h" |
46 #include "public/platform/WebScheduler.h" | |
48 #include "public/platform/WebThread.h" | 47 #include "public/platform/WebThread.h" |
49 #include "public/platform/WebWaitableEvent.h" | 48 #include "public/platform/WebWaitableEvent.h" |
50 #include "wtf/Noncopyable.h" | 49 #include "wtf/Noncopyable.h" |
51 #include "wtf/WeakPtr.h" | 50 #include "wtf/WeakPtr.h" |
52 #include "wtf/text/WTFString.h" | 51 #include "wtf/text/WTFString.h" |
53 | 52 |
54 namespace blink { | 53 namespace blink { |
55 | 54 |
56 namespace { | 55 namespace { |
57 const int64_t kShortIdleHandlerDelayMs = 1000; | |
58 const int64_t kLongIdleHandlerDelayMs = 10*1000; | |
59 | 56 |
60 class MicrotaskRunner : public WebThread::TaskObserver { | 57 class MicrotaskRunner : public WebThread::TaskObserver { |
61 public: | 58 public: |
62 explicit MicrotaskRunner(WorkerThread* workerThread) | 59 explicit MicrotaskRunner(WorkerThread* workerThread) |
63 : m_workerThread(workerThread) | 60 : m_workerThread(workerThread) |
64 { | 61 { |
65 } | 62 } |
66 | 63 |
67 virtual void willProcessTask() override { } | 64 virtual void willProcessTask() override { } |
68 virtual void didProcessTask() override | 65 virtual void didProcessTask() override |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 : m_closure(closure) | 121 : m_closure(closure) |
125 , m_weakFactory(this) | 122 , m_weakFactory(this) |
126 , m_taskCanceled(false) | 123 , m_taskCanceled(false) |
127 { } | 124 { } |
128 | 125 |
129 OwnPtr<Closure> m_closure; | 126 OwnPtr<Closure> m_closure; |
130 WeakPtrFactory<WorkerThreadCancelableTask> m_weakFactory; | 127 WeakPtrFactory<WorkerThreadCancelableTask> m_weakFactory; |
131 bool m_taskCanceled; | 128 bool m_taskCanceled; |
132 }; | 129 }; |
133 | 130 |
134 class WorkerSharedTimer : public SharedTimer { | |
135 public: | |
136 explicit WorkerSharedTimer(WorkerThread* workerThread) | |
137 : m_workerThread(workerThread) | |
138 , m_running(false) | |
139 { } | |
140 | |
141 typedef void (*SharedTimerFunction)(); | |
142 virtual void setFiredFunction(SharedTimerFunction func) | |
143 { | |
144 m_sharedTimerFunction = func; | |
145 } | |
146 | |
147 virtual void setFireInterval(double interval) | |
148 { | |
149 ASSERT(m_sharedTimerFunction); | |
150 | |
151 // See BlinkPlatformImpl::setSharedTimerFireInterval for explanation of | |
152 // why ceil is used in the interval calculation. | |
153 int64_t delay = static_cast<int64_t>(ceil(interval * 1000)); | |
154 | |
155 if (delay < 0) { | |
156 delay = 0; | |
157 } | |
158 | |
159 m_running = true; | |
160 | |
161 if (m_lastQueuedTask.get()) | |
162 m_lastQueuedTask->cancelTask(); | |
163 | |
164 // Now queue the task as a cancellable one. | |
165 OwnPtr<WorkerThreadCancelableTask> task = WorkerThreadCancelableTask::cr eate(bind(&WorkerSharedTimer::OnTimeout, this)); | |
166 m_lastQueuedTask = task->createWeakPtr(); | |
167 m_workerThread->postDelayedTask(FROM_HERE, task.release(), delay); | |
168 } | |
169 | |
170 virtual void stop() | |
171 { | |
172 m_running = false; | |
173 m_lastQueuedTask = nullptr; | |
174 } | |
175 | |
176 private: | |
177 void OnTimeout() | |
178 { | |
179 ASSERT(m_workerThread->workerGlobalScope()); | |
180 | |
181 m_lastQueuedTask = nullptr; | |
182 | |
183 if (m_sharedTimerFunction && m_running && !m_workerThread->workerGlobalS cope()->isClosing()) | |
184 m_sharedTimerFunction(); | |
185 } | |
186 | |
187 WorkerThread* m_workerThread; | |
188 SharedTimerFunction m_sharedTimerFunction; | |
189 bool m_running; | |
190 | |
191 // The task to run OnTimeout, if any. While OnTimeout resets | |
192 // m_lastQueuedTask, this must be a weak pointer because the | |
193 // worker runloop may delete the task as it is shutting down. | |
194 WeakPtr<WorkerThreadCancelableTask> m_lastQueuedTask; | |
195 }; | |
196 | |
197 class WorkerThreadTask : public blink::WebThread::Task { | 131 class WorkerThreadTask : public blink::WebThread::Task { |
198 WTF_MAKE_NONCOPYABLE(WorkerThreadTask); WTF_MAKE_FAST_ALLOCATED(WorkerThread Task); | 132 WTF_MAKE_NONCOPYABLE(WorkerThreadTask); WTF_MAKE_FAST_ALLOCATED(WorkerThread Task); |
199 public: | 133 public: |
200 static PassOwnPtr<WorkerThreadTask> create(WorkerThread& workerThread, PassO wnPtr<ExecutionContextTask> task, bool isInstrumented) | 134 static PassOwnPtr<WorkerThreadTask> create(WorkerThread& workerThread, PassO wnPtr<ExecutionContextTask> task, bool isInstrumented) |
201 { | 135 { |
202 return adoptPtr(new WorkerThreadTask(workerThread, task, isInstrumented) ); | 136 return adoptPtr(new WorkerThreadTask(workerThread, task, isInstrumented) ); |
203 } | 137 } |
204 | 138 |
205 virtual ~WorkerThreadTask() { } | 139 virtual ~WorkerThreadTask() { } |
206 | 140 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 | 191 |
258 WorkerThread::WorkerThread(const char* threadName, PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, PassOwnPtr<Worke rThreadStartupData> startupData) | 192 WorkerThread::WorkerThread(const char* threadName, PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, PassOwnPtr<Worke rThreadStartupData> startupData) |
259 : m_threadName(threadName) | 193 : m_threadName(threadName) |
260 , m_terminated(false) | 194 , m_terminated(false) |
261 , m_workerLoaderProxy(workerLoaderProxy) | 195 , m_workerLoaderProxy(workerLoaderProxy) |
262 , m_workerReportingProxy(workerReportingProxy) | 196 , m_workerReportingProxy(workerReportingProxy) |
263 , m_startupData(startupData) | 197 , m_startupData(startupData) |
264 , m_isolate(nullptr) | 198 , m_isolate(nullptr) |
265 , m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent() )) | 199 , m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent() )) |
266 , m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEven t())) | 200 , m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEven t())) |
201 , m_webScheduler(nullptr) | |
267 { | 202 { |
268 MutexLocker lock(threadSetMutex()); | 203 MutexLocker lock(threadSetMutex()); |
269 workerThreads().add(this); | 204 workerThreads().add(this); |
270 } | 205 } |
271 | 206 |
272 WorkerThread::~WorkerThread() | 207 WorkerThread::~WorkerThread() |
273 { | 208 { |
274 MutexLocker lock(threadSetMutex()); | 209 MutexLocker lock(threadSetMutex()); |
275 ASSERT(workerThreads().contains(this)); | 210 ASSERT(workerThreads().contains(this)); |
276 workerThreads().remove(this); | 211 workerThreads().remove(this); |
(...skipping 15 matching lines...) Expand all Loading... | |
292 m_workerInspectorController->interruptAndDispatchInspectorCommands(); | 227 m_workerInspectorController->interruptAndDispatchInspectorCommands(); |
293 } | 228 } |
294 | 229 |
295 PlatformThreadId WorkerThread::platformThreadId() const | 230 PlatformThreadId WorkerThread::platformThreadId() const |
296 { | 231 { |
297 if (!m_thread) | 232 if (!m_thread) |
298 return 0; | 233 return 0; |
299 return m_thread->platformThread().threadId(); | 234 return m_thread->platformThread().threadId(); |
300 } | 235 } |
301 | 236 |
237 class WorkerThreadIdleTask : public WebThread::IdleTask { | |
238 public: | |
239 explicit WorkerThreadIdleTask(WorkerThread* thread) | |
240 : m_thread(thread) { } | |
241 | |
242 ~WorkerThreadIdleTask() override { } | |
243 | |
244 void run(double deadlineSeconds) override | |
245 { | |
246 m_thread->idleTask(deadlineSeconds); | |
247 } | |
248 | |
249 private: | |
250 RawPtr<WorkerThread> m_thread; | |
251 }; | |
252 | |
302 void WorkerThread::initialize() | 253 void WorkerThread::initialize() |
303 { | 254 { |
304 KURL scriptURL = m_startupData->m_scriptURL; | 255 KURL scriptURL = m_startupData->m_scriptURL; |
305 String sourceCode = m_startupData->m_sourceCode; | 256 String sourceCode = m_startupData->m_sourceCode; |
306 WorkerThreadStartMode startMode = m_startupData->m_startMode; | 257 WorkerThreadStartMode startMode = m_startupData->m_startMode; |
307 OwnPtr<Vector<char>> cachedMetaData = m_startupData->m_cachedMetaData.releas e(); | 258 OwnPtr<Vector<char>> cachedMetaData = m_startupData->m_cachedMetaData.releas e(); |
308 V8CacheOptions v8CacheOptions = m_startupData->m_v8CacheOptions; | 259 V8CacheOptions v8CacheOptions = m_startupData->m_v8CacheOptions; |
309 | 260 |
310 { | 261 { |
311 MutexLocker lock(m_threadCreationMutex); | 262 MutexLocker lock(m_threadCreationMutex); |
312 | 263 |
313 // The worker was terminated before the thread had a chance to run. | 264 // The worker was terminated before the thread had a chance to run. |
314 if (m_terminated) { | 265 if (m_terminated) { |
315 // Notify the proxy that the WorkerGlobalScope has been disposed of. | 266 // Notify the proxy that the WorkerGlobalScope has been disposed of. |
316 // This can free this thread object, hence it must not be touched af terwards. | 267 // This can free this thread object, hence it must not be touched af terwards. |
317 m_workerReportingProxy.workerThreadTerminated(); | 268 m_workerReportingProxy.workerThreadTerminated(); |
318 return; | 269 return; |
319 } | 270 } |
320 | 271 |
321 m_microtaskRunner = adoptPtr(new MicrotaskRunner(this)); | 272 m_microtaskRunner = adoptPtr(new MicrotaskRunner(this)); |
322 m_thread->addTaskObserver(m_microtaskRunner.get()); | 273 m_thread->addTaskObserver(m_microtaskRunner.get()); |
323 m_thread->attachGC(); | 274 m_thread->attachGC(); |
324 | 275 |
325 m_isolate = initializeIsolate(); | 276 m_isolate = initializeIsolate(); |
326 m_workerGlobalScope = createWorkerGlobalScope(m_startupData.release()); | 277 m_workerGlobalScope = createWorkerGlobalScope(m_startupData.release()); |
327 m_workerGlobalScope->scriptLoaded(sourceCode.length(), cachedMetaData.ge t() ? cachedMetaData->size() : 0); | 278 m_workerGlobalScope->scriptLoaded(sourceCode.length(), cachedMetaData.ge t() ? cachedMetaData->size() : 0); |
328 | |
329 PlatformThreadData::current().threadTimers().setSharedTimer(adoptPtr(new WorkerSharedTimer(this))); | |
330 } | 279 } |
331 | 280 |
332 // The corresponding call to stopRunLoop() is in ~WorkerScriptController(). | 281 // The corresponding call to stopRunLoop() is in ~WorkerScriptController(). |
333 didStartRunLoop(); | 282 didStartRunLoop(); |
334 | 283 |
335 // Notify proxy that a new WorkerGlobalScope has been created and started. | 284 // Notify proxy that a new WorkerGlobalScope has been created and started. |
336 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); | 285 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); |
337 | 286 |
338 WorkerScriptController* script = m_workerGlobalScope->script(); | 287 WorkerScriptController* script = m_workerGlobalScope->script(); |
339 if (!script->isExecutionForbidden()) | 288 if (!script->isExecutionForbidden()) |
340 script->initializeContextIfNeeded(); | 289 script->initializeContextIfNeeded(); |
341 if (startMode == PauseWorkerGlobalScopeOnStart) | 290 if (startMode == PauseWorkerGlobalScopeOnStart) |
342 m_workerGlobalScope->workerInspectorController()->pauseOnStart(); | 291 m_workerGlobalScope->workerInspectorController()->pauseOnStart(); |
343 | 292 |
344 OwnPtr<CachedMetadataHandler> handler(workerGlobalScope()->createWorkerScrip tCachedMetadataHandler(scriptURL, cachedMetaData.get())); | 293 OwnPtr<CachedMetadataHandler> handler(workerGlobalScope()->createWorkerScrip tCachedMetadataHandler(scriptURL, cachedMetaData.get())); |
345 bool success = script->evaluate(ScriptSourceCode(sourceCode, scriptURL), nul lptr, handler.get(), v8CacheOptions); | 294 bool success = script->evaluate(ScriptSourceCode(sourceCode, scriptURL), nul lptr, handler.get(), v8CacheOptions); |
346 m_workerGlobalScope->didEvaluateWorkerScript(); | 295 m_workerGlobalScope->didEvaluateWorkerScript(); |
347 m_workerReportingProxy.didEvaluateWorkerScript(success); | 296 m_workerReportingProxy.didEvaluateWorkerScript(success); |
348 | 297 |
349 postInitialize(); | 298 postInitialize(); |
350 | 299 |
351 postDelayedTask(FROM_HERE, createSameThreadTask(&WorkerThread::idleHandler, this), kShortIdleHandlerDelayMs); | 300 m_webScheduler = m_thread->platformThread().scheduler(); |
301 m_webScheduler->postIdleTaskAfterWakeup(FROM_HERE, new WorkerThreadIdleTask( this)); | |
Sami
2015/04/16 14:23:38
There's no way this can run after this thread obje
alex clarke (OOO till 29th)
2015/04/16 17:20:01
I don't think so because when the thread goes away
| |
352 } | 302 } |
353 | 303 |
354 PassOwnPtr<WebThreadSupportingGC> WorkerThread::createWebThreadSupportingGC() | 304 PassOwnPtr<WebThreadSupportingGC> WorkerThread::createWebThreadSupportingGC() |
355 { | 305 { |
356 return WebThreadSupportingGC::create(m_threadName); | 306 return WebThreadSupportingGC::create(m_threadName); |
357 } | 307 } |
358 | 308 |
359 void WorkerThread::cleanup() | 309 void WorkerThread::cleanup() |
360 { | 310 { |
361 // This should be called before we start the shutdown procedure. | 311 // This should be called before we start the shutdown procedure. |
(...skipping 12 matching lines...) Expand all Loading... | |
374 destroyIsolate(); | 324 destroyIsolate(); |
375 | 325 |
376 m_thread->removeTaskObserver(m_microtaskRunner.get()); | 326 m_thread->removeTaskObserver(m_microtaskRunner.get()); |
377 m_microtaskRunner = nullptr; | 327 m_microtaskRunner = nullptr; |
378 | 328 |
379 // Notify the proxy that the WorkerGlobalScope has been disposed of. | 329 // Notify the proxy that the WorkerGlobalScope has been disposed of. |
380 // This can free this thread object, hence it must not be touched afterwards . | 330 // This can free this thread object, hence it must not be touched afterwards . |
381 workerReportingProxy().workerThreadTerminated(); | 331 workerReportingProxy().workerThreadTerminated(); |
382 | 332 |
383 m_terminationEvent->signal(); | 333 m_terminationEvent->signal(); |
384 | |
385 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! | |
386 PlatformThreadData::current().destroy(); | |
387 } | 334 } |
388 | 335 |
389 class WorkerThreadShutdownFinishTask : public ExecutionContextTask { | 336 class WorkerThreadShutdownFinishTask : public ExecutionContextTask { |
390 public: | 337 public: |
391 static PassOwnPtr<WorkerThreadShutdownFinishTask> create() | 338 static PassOwnPtr<WorkerThreadShutdownFinishTask> create() |
392 { | 339 { |
393 return adoptPtr(new WorkerThreadShutdownFinishTask()); | 340 return adoptPtr(new WorkerThreadShutdownFinishTask()); |
394 } | 341 } |
395 | 342 |
396 virtual void performTask(ExecutionContext *context) | 343 virtual void performTask(ExecutionContext *context) |
(...skipping 14 matching lines...) Expand all Loading... | |
411 public: | 358 public: |
412 static PassOwnPtr<WorkerThreadShutdownStartTask> create() | 359 static PassOwnPtr<WorkerThreadShutdownStartTask> create() |
413 { | 360 { |
414 return adoptPtr(new WorkerThreadShutdownStartTask()); | 361 return adoptPtr(new WorkerThreadShutdownStartTask()); |
415 } | 362 } |
416 | 363 |
417 virtual void performTask(ExecutionContext *context) | 364 virtual void performTask(ExecutionContext *context) |
418 { | 365 { |
419 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 366 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
420 workerGlobalScope->stopActiveDOMObjects(); | 367 workerGlobalScope->stopActiveDOMObjects(); |
421 PlatformThreadData::current().threadTimers().setSharedTimer(nullptr); | |
422 | 368 |
423 // Event listeners would keep DOMWrapperWorld objects alive for too long . Also, they have references to JS objects, | 369 // Event listeners would keep DOMWrapperWorld objects alive for too long . Also, they have references to JS objects, |
424 // which become dangling once Heap is destroyed. | 370 // which become dangling once Heap is destroyed. |
425 workerGlobalScope->removeAllEventListeners(); | 371 workerGlobalScope->removeAllEventListeners(); |
426 | 372 |
427 // Stick a shutdown command at the end of the queue, so that we deal | 373 // Stick a shutdown command at the end of the queue, so that we deal |
428 // with all the cleanup tasks the databases post first. | 374 // with all the cleanup tasks the databases post first. |
429 workerGlobalScope->postTask(FROM_HERE, WorkerThreadShutdownFinishTask::c reate()); | 375 workerGlobalScope->postTask(FROM_HERE, WorkerThreadShutdownFinishTask::c reate()); |
430 } | 376 } |
431 | 377 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 | 449 |
504 for (WorkerThread* thread : threads) | 450 for (WorkerThread* thread : threads) |
505 thread->terminationEvent()->wait(); | 451 thread->terminationEvent()->wait(); |
506 } | 452 } |
507 | 453 |
508 bool WorkerThread::isCurrentThread() const | 454 bool WorkerThread::isCurrentThread() const |
509 { | 455 { |
510 return m_thread && m_thread->isCurrentThread(); | 456 return m_thread && m_thread->isCurrentThread(); |
511 } | 457 } |
512 | 458 |
513 void WorkerThread::idleHandler() | 459 void WorkerThread::idleTask(double deadlineSeconds) |
514 { | 460 { |
515 ASSERT(m_workerGlobalScope.get()); | 461 double gcDeadlineSeconds = deadlineSeconds; |
516 int64_t delay = kLongIdleHandlerDelayMs; | |
517 | 462 |
518 // Do a script engine idle notification if the next event is distant enough. | 463 // The V8 GC does some GC steps (e.g. compaction) only when the idle notific ation is ~1s. |
519 const double kMinIdleTimespan = 0.3; | 464 // TODO(rmcilroy): Refactor so extending the deadline like this this isn't n eeded. |
520 const double nextFireTime = PlatformThreadData::current().threadTimers().nex tFireTime(); | 465 if (m_webScheduler->canExceedIdleDeadlineIfRequired()) |
521 if (nextFireTime == 0.0 || nextFireTime > currentTime() + kMinIdleTimespan) { | 466 gcDeadlineSeconds = Platform::current()->monotonicallyIncreasingTime() + 1.0; |
522 bool hasMoreWork = !isolate()->IdleNotificationDeadline(Platform::curren t()->monotonicallyIncreasingTime() + 1.0); | 467 |
523 if (hasMoreWork) | 468 if (doIdleGc(gcDeadlineSeconds)) |
524 delay = kShortIdleHandlerDelayMs; | 469 m_webScheduler->postIdleTaskAfterWakeup(FROM_HERE, new WorkerThreadIdleT ask(this)); |
470 else | |
471 m_webScheduler->postIdleTask(FROM_HERE, new WorkerThreadIdleTask(this)); | |
472 } | |
473 | |
474 bool WorkerThread::doIdleGc(double deadlineSeconds) | |
475 { | |
476 if (deadlineSeconds > Platform::current()->monotonicallyIncreasingTime()) { | |
477 return isolate()->IdleNotificationDeadline(deadlineSeconds); | |
525 } | 478 } |
526 | 479 |
527 postDelayedTask(FROM_HERE, createSameThreadTask(&WorkerThread::idleHandler, this), delay); | 480 return false; |
528 } | 481 } |
529 | 482 |
530 void WorkerThread::postTask(const WebTraceLocation& location, PassOwnPtr<Executi onContextTask> task) | 483 void WorkerThread::postTask(const WebTraceLocation& location, PassOwnPtr<Executi onContextTask> task) |
531 { | 484 { |
532 m_thread->postTask(location, WorkerThreadTask::create(*this, task, true).lea kPtr()); | 485 m_thread->postTask(location, WorkerThreadTask::create(*this, task, true).lea kPtr()); |
533 } | 486 } |
534 | 487 |
535 void WorkerThread::postDelayedTask(const WebTraceLocation& location, PassOwnPtr< ExecutionContextTask> task, long long delayMs) | 488 void WorkerThread::postDelayedTask(const WebTraceLocation& location, PassOwnPtr< ExecutionContextTask> task, long long delayMs) |
536 { | 489 { |
537 m_thread->postDelayedTask(location, WorkerThreadTask::create(*this, task, tr ue).leakPtr(), delayMs); | 490 m_thread->postDelayedTask(location, WorkerThreadTask::create(*this, task, tr ue).leakPtr(), delayMs); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
611 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 564 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
612 } | 565 } |
613 | 566 |
614 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) | 567 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) |
615 { | 568 { |
616 MutexLocker locker(m_workerInspectorControllerMutex); | 569 MutexLocker locker(m_workerInspectorControllerMutex); |
617 m_workerInspectorController = workerInspectorController; | 570 m_workerInspectorController = workerInspectorController; |
618 } | 571 } |
619 | 572 |
620 } // namespace blink | 573 } // namespace blink |
OLD | NEW |