Changeset 142163 in webkit
- Timestamp:
- Feb 7, 2013 12:35:09 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r142129 r142163 1 2013-02-07 Benjamin Poulain <bpoulain@apple.com> 2 3 Upstream iOS isWebThread() and isUIThread() 4 https://bugs.webkit.org/show_bug.cgi?id=109130 5 6 Reviewed by Sam Weinig. 7 8 On iOS, it is sometimes necessary to differenciate the thread running WebCore, 9 and the thread running the UI. This patch upstream those functions. 10 11 * wtf/MainThread.cpp: 12 * wtf/MainThread.h: 13 Disable the legacy initializer as it is incorrect when using the WebThread to run WebCore. 14 (WTF::isWebThread): 15 (WTF::isUIThread): 16 Return true when the current thread is the Web/UI thread. 17 18 * wtf/mac/MainThreadMac.mm: 19 (WTF::isUIThread): 20 (WTF::isWebThread): 21 22 * wtf/text/AtomicString.cpp: 23 (WTF::AtomicStringTable::create): 24 Use the newly added methods. 25 1 26 2013-02-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 27 -
trunk/Source/WTF/wtf/MainThread.cpp
r111778 r142163 121 121 } 122 122 123 #if !USE(WEB_THREAD) 123 124 static void initializeMainThreadToProcessMainThreadOnce() 124 125 { … … 131 132 pthread_once(&initializeMainThreadKeyOnce, initializeMainThreadToProcessMainThreadOnce); 132 133 } 134 #endif // !USE(WEB_THREAD) 135 133 136 #endif 134 137 -
trunk/Source/WTF/wtf/MainThread.h
r131496 r142163 52 52 WTF_EXPORT_PRIVATE bool isMainThread(); 53 53 54 #if USE(WEB_THREAD) 55 WTF_EXPORT_PRIVATE bool isWebThread(); 56 WTF_EXPORT_PRIVATE bool isUIThread(); 57 #else 58 inline bool isWebThread() { return isMainThread(); } 59 inline bool isUIThread() { return isMainThread(); } 60 #endif // PLATFORM(IOS) 61 62 54 63 void initializeGCThreads(); 55 64 … … 69 78 70 79 #if PLATFORM(MAC) 80 #if !USE(WEB_THREAD) 71 81 // This version of initializeMainThread sets up the main thread as corresponding 72 82 // to the process's main thread, and not necessarily the thread that calls this 73 83 // function. It should only be used as a legacy aid for Mac WebKit. 74 84 WTF_EXPORT_PRIVATE void initializeMainThreadToProcessMainThread(); 85 #endif // !USE(WEB_THREAD) 75 86 void initializeMainThreadToProcessMainThreadPlatform(); 76 87 #endif -
trunk/Source/WTF/wtf/mac/MainThreadMac.mm
r111778 r142163 71 71 } 72 72 73 #if !USE(WEB_THREAD) 73 74 void initializeMainThreadToProcessMainThreadPlatform() 74 75 { … … 85 86 initializeGCThreads(); 86 87 } 88 #endif // !USE(WEB_THREAD) 87 89 88 90 static void timerFired(CFRunLoopTimerRef timer, void*) … … 134 136 } 135 137 138 #if USE(WEB_THREAD) 139 bool isUIThread() 140 { 141 return pthread_main_np(); 142 } 143 144 bool isWebThread() 145 { 146 return pthread_equal(pthread_self(), mainThreadPthread); 147 } 148 #endif // USE(WEB_THREAD) 149 136 150 } // namespace WTF -
trunk/Source/WTF/wtf/text/AtomicString.cpp
r141819 r142163 75 75 76 76 bool currentThreadIsWebThread = isWebThread(); 77 if (currentThreadIsWebThread || pthread_main_np())77 if (currentThreadIsWebThread || isUIThread()) 78 78 data.m_atomicStringTable = sharedStringTable; 79 79 else -
trunk/Source/WebCore/ChangeLog
r142161 r142163 1 2013-02-07 Benjamin Poulain <bpoulain@apple.com> 2 3 Upstream iOS isWebThread() and isUIThread() 4 https://bugs.webkit.org/show_bug.cgi?id=109130 5 6 Reviewed by Sam Weinig. 7 8 * bindings/objc/WebScriptObject.mm: 9 (+[WebScriptObject initialize]): 10 * platform/mac/SharedBufferMac.mm: 11 (+[WebCoreSharedBufferData initialize]): 12 #ifdef out the legacy initialization as it is not correct when 13 using a WebThread. 14 1 15 2013-02-07 Vivek Galatage <vivek.vg@samsung.com> 2 16 -
trunk/Source/WebCore/bindings/objc/WebScriptObject.mm
r136986 r142163 128 128 + (void)initialize 129 129 { 130 #if !USE(WEB_THREAD) 130 131 JSC::initializeThreading(); 131 132 WTF::initializeMainThreadToProcessMainThread(); 133 #endif // !USE(WEB_THREAD) 132 134 WebCoreObjCFinalizeOnMainThread(self); 133 135 } -
trunk/Source/WebCore/platform/mac/SharedBufferMac.mm
r99239 r142163 48 48 + (void)initialize 49 49 { 50 #if !USE(WEB_THREAD) 50 51 JSC::initializeThreading(); 51 52 #if PLATFORM(QT) && USE(QTKIT) … … 54 55 WTF::initializeMainThreadToProcessMainThread(); 55 56 #endif 57 #endif // !USE(WEB_THREAD) 56 58 WebCoreObjCFinalizeOnMainThread(self); 57 59 }
Note: See TracChangeset
for help on using the changeset viewer.