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

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

Issue 671913003: Revert of Signal WorkerThread termination earlier (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 ASSERT(m_workerGlobalScope->hasOneRef()); 338 ASSERT(m_workerGlobalScope->hasOneRef());
339 #endif 339 #endif
340 m_workerGlobalScope->dispose(); 340 m_workerGlobalScope->dispose();
341 m_workerGlobalScope = nullptr; 341 m_workerGlobalScope = nullptr;
342 342
343 m_thread->detachGC(); 343 m_thread->detachGC();
344 344
345 m_thread->removeTaskObserver(m_microtaskRunner.get()); 345 m_thread->removeTaskObserver(m_microtaskRunner.get());
346 m_microtaskRunner = nullptr; 346 m_microtaskRunner = nullptr;
347 347
348 m_terminationEvent->signal();
349
350 // Notify the proxy that the WorkerGlobalScope has been disposed of. 348 // Notify the proxy that the WorkerGlobalScope has been disposed of.
351 // This can free this thread object, hence it must not be touched afterwards . 349 // This can free this thread object, hence it must not be touched afterwards .
352 workerReportingProxy().workerThreadTerminated(); 350 workerReportingProxy().workerThreadTerminated();
353 351
352 m_terminationEvent->signal();
353
354 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! 354 // Clean up PlatformThreadData before WTF::WTFThreadData goes away!
355 PlatformThreadData::current().destroy(); 355 PlatformThreadData::current().destroy();
356 } 356 }
357 357
358 class WorkerThreadShutdownFinishTask : public ExecutionContextTask { 358 class WorkerThreadShutdownFinishTask : public ExecutionContextTask {
359 public: 359 public:
360 static PassOwnPtr<WorkerThreadShutdownFinishTask> create() 360 static PassOwnPtr<WorkerThreadShutdownFinishTask> create()
361 { 361 {
362 return adoptPtr(new WorkerThreadShutdownFinishTask()); 362 return adoptPtr(new WorkerThreadShutdownFinishTask());
363 } 363 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); 523 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get());
524 } 524 }
525 525
526 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) 526 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
527 { 527 {
528 MutexLocker locker(m_workerInspectorControllerMutex); 528 MutexLocker locker(m_workerInspectorControllerMutex);
529 m_workerInspectorController = workerInspectorController; 529 m_workerInspectorController = workerInspectorController;
530 } 530 }
531 531
532 } // namespace blink 532 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698