Changeset 57732 in webkit
- Timestamp:
- Apr 16, 2010 12:36:08 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r57707 r57732 1 2010-04-16 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by David Hyatt. 4 5 Make run loops be allocated as thread specific data. 6 https://bugs.webkit.org/show_bug.cgi?id=37723 7 8 * Platform/RunLoop.cpp: 9 (RunLoop::initializeMainRunLoop): 10 (RunLoop::current): 11 (RunLoop::main): 12 * Platform/RunLoop.h: 13 * Platform/mac/RunLoopMac.mm: 14 (RunLoop::run): 15 (RunLoop::stop): 16 * UIProcess/Launcher/mac/WebProcessLauncher.mm: 17 (WebKit::webThreadBody): 18 (WebKit::launchWebProcess): 19 * UIProcess/ResponsivenessTimer.cpp: 20 (WebKit::ResponsivenessTimer::ResponsivenessTimer): 21 * WebProcess/Launching/mac/WebProcessMain.mm: 22 (main): 23 * WebProcess/WebProcess.cpp: 24 (WebKit::WebProcess::isSeparateProcess): 25 1 26 2010-04-16 Sam Weinig <weinig@apple.com> 2 27 -
trunk/WebKit2/Platform/RunLoop.cpp
r57454 r57732 27 27 28 28 #include "WorkItem.h" 29 #include <wtf/StdLibExtras.h> 29 30 30 31 static RunLoop* s_mainRunLoop; … … 34 35 if (s_mainRunLoop) 35 36 return; 36 s_mainRunLoop = new RunLoop;37 s_mainRunLoop = RunLoop::current(); 37 38 } 38 39 39 RunLoop* RunLoop::mainRunLoop() 40 RunLoop* RunLoop::current() 41 { 42 DEFINE_STATIC_LOCAL(WTF::ThreadSpecific<RunLoop>, runLoopData, ()); 43 return &*runLoopData; 44 } 45 46 RunLoop* RunLoop::main() 40 47 { 41 48 ASSERT(s_mainRunLoop); -
trunk/WebKit2/Platform/RunLoop.h
r57454 r57732 29 29 #include <memory> 30 30 #include <wtf/HashMap.h> 31 #include <wtf/ThreadSpecific.h> 31 32 #include <wtf/Threading.h> 32 33 #include <wtf/Vector.h> … … 38 39 // Must be called from the main thread. 39 40 static void initializeMainRunLoop(); 40 static RunLoop* mainRunLoop();41 41 42 RunLoop();43 ~RunLoop();42 static RunLoop* current(); 43 static RunLoop* main(); 44 44 45 45 void scheduleWork(std::auto_ptr<WorkItem>); 46 46 47 void run();47 static void run(); 48 48 void stop(); 49 49 … … 96 96 97 97 private: 98 friend class WTF::ThreadSpecific<RunLoop>; 99 100 RunLoop(); 101 ~RunLoop(); 102 98 103 void performWork(); 99 104 void wakeUp(); -
trunk/WebKit2/Platform/mac/RunLoopMac.mm
r57547 r57732 51 51 void RunLoop::run() 52 52 { 53 ASSERT(m_runLoop == CFRunLoopGetCurrent()); 54 55 if (m_runLoop == mainRunLoop()->m_runLoop) { 53 if (current() == main()) { 56 54 // Use -[NSApplication run] for the main run loop. 57 55 [NSApp run]; … … 66 64 ASSERT(m_runLoop == CFRunLoopGetCurrent()); 67 65 68 if (m_runLoop == main RunLoop()->m_runLoop) {66 if (m_runLoop == main()->m_runLoop) { 69 67 [NSApp stop:nil]; 70 68 NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined -
trunk/WebKit2/UIProcess/Launcher/mac/WebProcessLauncher.mm
r57310 r57732 50 50 JSC::initializeThreading(); 51 51 52 RunLoop runLoop; 53 WebProcess::shared().initialize(serverPort, &runLoop); 52 WebProcess::shared().initialize(serverPort, RunLoop::current()); 54 53 55 54 [pool drain]; 56 55 57 runLoop.run();56 RunLoop::current()->run(); 58 57 59 58 return 0; … … 71 70 mach_port_insert_right(mach_task_self(), listeningPort, listeningPort, MACH_MSG_TYPE_MAKE_SEND); 72 71 73 info.connection = CoreIPC::Connection::createServerConnection(listeningPort, client, RunLoop::main RunLoop());72 info.connection = CoreIPC::Connection::createServerConnection(listeningPort, client, RunLoop::main()); 74 73 info.connection->open(); 75 74 -
trunk/WebKit2/UIProcess/ResponsivenessTimer.cpp
r57359 r57732 35 35 : m_client(client) 36 36 , m_isResponsive(true) 37 , m_timer(RunLoop::main RunLoop(), this, &ResponsivenessTimer::timerFired)37 , m_timer(RunLoop::main(), this, &ResponsivenessTimer::timerFired) 38 38 { 39 39 } -
trunk/WebKit2/WebProcess/Launching/mac/WebProcessMain.mm
r57309 r57732 63 63 64 64 // Create the connection. 65 WebProcess::shared().initialize(serverPort, RunLoop::main RunLoop());65 WebProcess::shared().initialize(serverPort, RunLoop::main()); 66 66 67 67 [pool drain]; … … 70 70 [NSApplication sharedApplication]; 71 71 72 RunLoop:: mainRunLoop()->run();72 RunLoop::run(); 73 73 74 74 // FIXME: Do more cleanup here. -
trunk/WebKit2/WebProcess/WebProcess.cpp
r57549 r57732 88 88 { 89 89 // If we're running on the main run loop, we assume that we're in a separate process. 90 return m_runLoop == RunLoop::main RunLoop();90 return m_runLoop == RunLoop::main(); 91 91 } 92 92
Note: See TracChangeset
for help on using the changeset viewer.