Changeset 31198 in webkit
- Timestamp:
- Mar 20, 2008 5:14:31 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31197 r31198 1 2008-03-20 Adam Roben <aroben@apple.com> 2 3 Allow pausing of callOnMainThread callbacks 4 5 Part of Bug 17133: Should support pausing JavaScript execution without 6 hanging the process 7 8 <http://bugs.webkit.org/show_bug.cgi?id=17133> 9 <rdar://problem/5719551> 10 11 Reviewed by Tim Hatcher. 12 13 * platform/MainThread.cpp: 14 (WebCore::dispatchFunctionsFromMainThread): If callbacks are paused, 15 don't dispatch the functions. 16 (WebCore::setMainThreadCallbacksPaused): Added. If we're being 17 unpaused, call scheduleDispatchFunctionsOnMainThread so that any 18 queued callbacks will get dispatched in the near future. 19 * platform/MainThread.h: 20 1 21 2008-03-20 Adam Roben <aroben@apple.com> 2 22 -
trunk/WebCore/platform/MainThread.cpp
r31068 r31198 43 43 typedef Vector<FunctionWithContext> FunctionQueue; 44 44 45 static bool callbacksPaused; 46 45 47 static Mutex& functionQueueMutex() 46 48 { … … 57 59 void dispatchFunctionsFromMainThread() 58 60 { 61 if (callbacksPaused) 62 return; 63 59 64 FunctionQueue queueCopy; 60 65 { … … 80 85 } 81 86 87 void setMainThreadCallbacksPaused(bool paused) 88 { 89 if (callbacksPaused == paused) 90 return; 91 92 callbacksPaused = paused; 93 94 if (!callbacksPaused) 95 scheduleDispatchFunctionsOnMainThread(); 96 } 97 82 98 } // namespace WebCore -
trunk/WebCore/platform/MainThread.h
r31063 r31198 38 38 39 39 void callOnMainThread(MainThreadFunction*, void* context); 40 void setMainThreadCallbacksPaused(bool paused); 40 41 41 42 void initializeThreadingAndMainThread();
Note: See TracChangeset
for help on using the changeset viewer.