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

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

Issue 956333002: Refactor TimeBase to post tasks. Workers to use real Idle tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 8 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
« no previous file with comments | « Source/core/frame/DOMTimerCoordinator.cpp ('k') | Source/core/workers/WorkerLoaderProxy.h » ('j') | 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 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 void WorkerGlobalScope::close() 177 void WorkerGlobalScope::close()
178 { 178 {
179 if (m_closing) 179 if (m_closing)
180 return; 180 return;
181 181
182 // Let current script run to completion but prevent future script evaluation s. 182 // Let current script run to completion but prevent future script evaluation s.
183 // After m_closing is set, all the tasks in the queue continue to be fetched but only 183 // After m_closing is set, all the tasks in the queue continue to be fetched but only
184 // tasks with isCleanupTask()==true will be executed. 184 // tasks with isCleanupTask()==true will be executed.
185 m_closing = true; 185 m_closing = true;
186 m_thread->preShutdown();
186 postTask(FROM_HERE, CloseWorkerGlobalScopeTask::create()); 187 postTask(FROM_HERE, CloseWorkerGlobalScopeTask::create());
187 } 188 }
188 189
189 WorkerConsole* WorkerGlobalScope::console() 190 WorkerConsole* WorkerGlobalScope::console()
190 { 191 {
191 if (!m_console) 192 if (!m_console)
192 m_console = WorkerConsole::create(this); 193 m_console = WorkerConsole::create(this);
193 return m_console.get(); 194 return m_console.get();
194 } 195 }
195 196
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 visitor->trace(m_timers); 397 visitor->trace(m_timers);
397 visitor->trace(m_messageStorage); 398 visitor->trace(m_messageStorage);
398 visitor->trace(m_pendingMessages); 399 visitor->trace(m_pendingMessages);
399 HeapSupplementable<WorkerGlobalScope>::trace(visitor); 400 HeapSupplementable<WorkerGlobalScope>::trace(visitor);
400 #endif 401 #endif
401 ExecutionContext::trace(visitor); 402 ExecutionContext::trace(visitor);
402 EventTargetWithInlineData::trace(visitor); 403 EventTargetWithInlineData::trace(visitor);
403 } 404 }
404 405
405 } // namespace blink 406 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/DOMTimerCoordinator.cpp ('k') | Source/core/workers/WorkerLoaderProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698