Changeset 101477 in webkit
- Timestamp:
- Nov 30, 2011 3:17:46 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r101456 r101477 1 2011-11-30 Andrew Wason <rectalogic@rectalogic.com> 2 3 Replace Qt QThread threading back-end with pthread/Win32 threading back-ends 4 https://bugs.webkit.org/show_bug.cgi?id=72155 5 6 Reviewed by Simon Hausmann. 7 8 Add additional WebCoreSupport files for Qt. 9 10 * Source/api.pri: 11 1 12 2011-11-30 Adenilson Cavalcanti <adenilson.silva@openbossa.org> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r101473 r101477 1 2011-11-30 Andrew Wason <rectalogic@rectalogic.com> 2 3 Replace Qt QThread threading back-end with pthread/Win32 threading back-ends 4 https://bugs.webkit.org/show_bug.cgi?id=72155 5 6 Reviewed by Simon Hausmann. 7 8 Use ThreadingPthreads and ThreadingWin instead of ThreadingQt. 9 10 * heap/MachineStackMarker.cpp: 11 * wtf/MainThread.cpp: 12 (WTF::initializeMainThread): 13 * wtf/Platform.h: 14 * wtf/ThreadSpecific.h: Drop QThreadStorage related code. 15 (WTF::::destroy): 16 * wtf/ThreadingPrimitives.h: 17 * wtf/qt/MainThreadQt.cpp: Drop Qt specific isMainThread(). 18 (WTF::initializeMainThreadPlatform): Initialize MainThreadInvoker on main thread to avoid infecting secondary thread with QAdoptedThread. 19 (WTF::scheduleDispatchFunctionsOnMainThread): 20 * wtf/qt/ThreadingQt.cpp: Removed. 21 * wtf/wtf.pro: 22 1 23 2011-11-30 Csaba Osztrogonác <ossy@webkit.org> 2 24 -
trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp
r96722 r101477 31 31 #include <wtf/StdLibExtras.h> 32 32 33 #if USE(PTHREAD_BASED_QT) && !defined(WTF_USE_PTHREADS)34 #define WTF_USE_PTHREADS 135 #endif36 37 33 #if OS(DARWIN) 38 34 -
trunk/Source/JavaScriptCore/wtf/MainThread.cpp
r95555 r101477 71 71 72 72 static bool callbacksPaused; // This global variable is only accessed from main thread. 73 #if !PLATFORM(MAC) && !PLATFORM(QT)73 #if !PLATFORM(MAC) 74 74 static ThreadIdentifier mainThreadIdentifier; 75 75 #endif … … 97 97 initializedMainThread = true; 98 98 99 #if !PLATFORM(QT)100 99 mainThreadIdentifier = currentThread(); 101 #endif102 100 103 101 mainThreadFunctionQueueMutex(); … … 232 230 } 233 231 234 #if !PLATFORM(MAC) && !PLATFORM(QT)232 #if !PLATFORM(MAC) 235 233 bool isMainThread() 236 234 { -
trunk/Source/JavaScriptCore/wtf/Platform.h
r101141 r101477 491 491 #endif 492 492 493 #if PLATFORM(QT) && OS(UNIX) && !OS(DARWIN)494 #define WTF_USE_PTHREAD_BASED_QT 1495 #endif496 497 493 /* On Windows, use QueryPerformanceCounter by default */ 498 494 #if OS(WINDOWS) … … 646 642 #define HAVE_PTHREAD_RWLOCK 1 647 643 #endif 644 #elif PLATFORM(QT) && OS(UNIX) 645 #define WTF_USE_PTHREADS 1 646 #define HAVE_PTHREAD_RWLOCK 1 648 647 #endif 649 648 -
trunk/Source/JavaScriptCore/wtf/ThreadSpecific.h
r98937 r101477 46 46 #if USE(PTHREADS) 47 47 #include <pthread.h> 48 #elif PLATFORM(QT)49 #include <QThreadStorage>50 48 #elif PLATFORM(GTK) 51 49 #include <glib.h> … … 91 89 public: 92 90 Data(T* value, ThreadSpecific<T>* owner) : value(value), owner(owner) {} 93 #if PLATFORM(QT)94 ~Data() { owner->destroy(this); }95 #endif96 91 97 92 T* value; … … 105 100 #if USE(PTHREADS) 106 101 pthread_key_t m_key; 107 #elif PLATFORM(QT)108 QThreadStorage<Data*> m_key;109 102 #elif PLATFORM(GTK) 110 103 GStaticPrivate m_key; … … 135 128 ASSERT(!get()); 136 129 pthread_setspecific(m_key, new Data(ptr, this)); 137 }138 139 #elif PLATFORM(QT)140 141 template<typename T>142 inline ThreadSpecific<T>::ThreadSpecific()143 {144 }145 146 template<typename T>147 inline T* ThreadSpecific<T>::get()148 {149 Data* data = static_cast<Data*>(m_key.localData());150 return data ? data->value : 0;151 }152 153 template<typename T>154 inline void ThreadSpecific<T>::set(T* ptr)155 {156 ASSERT(!get());157 Data* data = new Data(ptr, this);158 m_key.setLocalData(data);159 130 } 160 131 … … 251 222 g_static_private_set(&data->owner->m_key, data, 0); 252 223 #endif 253 #if PLATFORM(QT)254 // See comment as above255 data->owner->m_key.setLocalData(data);256 #endif257 224 258 225 data->value->~T(); … … 261 228 #if USE(PTHREADS) 262 229 pthread_setspecific(data->owner->m_key, 0); 263 #elif PLATFORM(QT)264 // Do nothing here265 230 #elif PLATFORM(GTK) 266 231 g_static_private_set(&data->owner->m_key, 0, 0); … … 271 236 #endif 272 237 273 #if !PLATFORM(QT)274 238 delete data; 275 #endif276 239 } 277 240 -
trunk/Source/JavaScriptCore/wtf/ThreadingPrimitives.h
r97269 r101477 47 47 #endif 48 48 49 #if PLATFORM(QT)50 #include <qglobal.h>51 QT_BEGIN_NAMESPACE52 class QMutex;53 class QWaitCondition;54 QT_END_NAMESPACE55 #endif56 57 49 namespace WTF { 58 50 … … 65 57 #endif 66 58 typedef pthread_cond_t PlatformCondition; 67 #elif PLATFORM(QT)68 typedef QT_PREPEND_NAMESPACE(QMutex)* PlatformMutex;69 typedef void* PlatformReadWriteLock; // FIXME: Implement.70 typedef QT_PREPEND_NAMESPACE(QWaitCondition)* PlatformCondition;71 59 #elif OS(WINDOWS) 72 60 struct PlatformMutex { -
trunk/Source/JavaScriptCore/wtf/qt/MainThreadQt.cpp
r101134 r101477 66 66 void initializeMainThreadPlatform() 67 67 { 68 webkit_main_thread_invoker(); 68 69 } 69 70 70 71 void scheduleDispatchFunctionsOnMainThread() 71 72 { 72 QObject* invoker = webkit_main_thread_invoker(); 73 if (invoker->thread() != QCoreApplication::instance()->thread()) { 74 ASSERT(invoker->thread() == QThread::currentThread()); 75 invoker->moveToThread(QCoreApplication::instance()->thread()); 76 } 77 QCoreApplication::postEvent(invoker, new QEvent(static_cast<QEvent::Type>(s_mainThreadInvokerEventType))); 78 } 79 80 bool isMainThread() 81 { 82 return QThread::currentThread() == QCoreApplication::instance()->thread(); 73 QCoreApplication::postEvent(webkit_main_thread_invoker(), new QEvent(static_cast<QEvent::Type>(s_mainThreadInvokerEventType))); 83 74 } 84 75 -
trunk/Source/JavaScriptCore/wtf/wtf.pro
r101295 r101477 169 169 170 170 171 unix: HEADERS += ThreadIdentifierDataPthreads.h 172 171 173 SOURCES += \ 172 174 ArrayBuffer.cpp \ … … 199 201 qt/MainThreadQt.cpp \ 200 202 qt/StringQt.cpp \ 201 qt/ThreadingQt.cpp \202 203 PageAllocationAligned.cpp \ 203 204 PageBlock.cpp \ … … 221 222 unicode/UTF8.cpp 222 223 223 unix: SOURCES += OSAllocatorPosix.cpp 224 win*|wince*: SOURCES += OSAllocatorWin.cpp 224 unix: SOURCES += \ 225 OSAllocatorPosix.cpp \ 226 ThreadIdentifierDataPthreads.cpp \ 227 ThreadingPthreads.cpp 228 229 win*|wince*: SOURCES += \ 230 OSAllocatorWin.cpp \ 231 ThreadSpecificWin.cpp \ 232 ThreadingWin.cpp 225 233 226 234 *sh4* { -
trunk/Source/WebCore/ChangeLog
r101474 r101477 1 2011-11-30 Andrew Wason <rectalogic@rectalogic.com> 2 3 Replace Qt QThread threading back-end with pthread/Win32 threading back-ends 4 https://bugs.webkit.org/show_bug.cgi?id=72155 5 6 Reviewed by Simon Hausmann. 7 8 Need to include qglobal.h since ThreadingPrimitives.h no longer does. 9 10 * platform/network/NetworkingContext.h: 11 1 12 2011-11-30 Jongseok Yang <js45.yang@samsung.com> 2 13 -
trunk/Source/WebCore/platform/network/NetworkingContext.h
r100731 r101477 28 28 29 29 #if PLATFORM(QT) 30 #include <qglobal.h> 30 31 QT_BEGIN_NAMESPACE 31 32 class QObject; -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r101307 r101477 23 23 #include "qwebpage.h" 24 24 25 #include "qwebelement_p.h"26 25 #include "qwebview.h" 27 26 #include "qwebframe.h" … … 77 76 #include "HitTestResult.h" 78 77 #include "Image.h" 78 #include "InitWebCoreQt.h" 79 79 #include "InspectorClientQt.h" 80 80 #include "InspectorController.h" … … 82 82 #include "KURL.h" 83 83 #include "LocalizedStrings.h" 84 #include "Logging.h"85 84 #include "MIMETypeRegistry.h" 86 85 #include "NavigationAction.h" … … 94 93 #include "Pasteboard.h" 95 94 #include "PlatformKeyboardEvent.h" 96 #include "PlatformStrategiesQt.h"97 95 #include "PlatformTouchEvent.h" 98 96 #include "PlatformWheelEvent.h" … … 108 106 #include "Scrollbar.h" 109 107 #include "SecurityOrigin.h" 110 #include "SecurityPolicy.h"111 108 #include "Settings.h" 112 109 #if defined Q_OS_WIN32 … … 115 112 #include "TextIterator.h" 116 113 #include "UtilsQt.h" 117 #if USE(QTKIT)118 #include "WebSystemInterface.h"119 #endif120 114 #include "WindowFeatures.h" 121 115 #include "WorkerThread.h" 122 #include <runtime/InitializeThreading.h>123 #include <wtf/MainThread.h>124 116 125 117 #include <QApplication> … … 319 311 , m_lastDropAction(Qt::IgnoreAction) 320 312 { 321 WebCore::InitializeLoggingChannelsIfNecessary(); 322 ScriptController::initializeThreading(); 323 WTF::initializeMainThread(); 324 WebCore::SecurityPolicy::setLocalLoadPolicy(WebCore::SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData); 325 326 PlatformStrategiesQt::initialize(); 327 QtWebElementRuntime::initialize(); 328 329 #if USE(QTKIT) 330 InitWebCoreSystemInterface(); 331 #endif 313 WebCore::initializeWebCoreQt(); 332 314 333 315 Page::PageClients pageClients; -
trunk/Source/WebKit/qt/Api/qwebsettings.cpp
r100614 r101477 32 32 #include "IconDatabaseClientQt.h" 33 33 #endif 34 #include "InitWebCoreQt.h" 34 35 #include "Page.h" 35 36 #include "PageCache.h" … … 279 280 { 280 281 static QWebSettings* global = 0; 281 if (!global) 282 if (!global) { 283 WebCore::initializeWebCoreQt(); 282 284 global = new QWebSettings; 285 } 283 286 return global; 284 287 } … … 649 652 void QWebSettings::setIconDatabasePath(const QString& path) 650 653 { 654 WebCore::initializeWebCoreQt(); 651 655 #if ENABLE(ICONDATABASE) 652 656 // Make sure that IconDatabaseClientQt is instantiated. … … 675 679 QString QWebSettings::iconDatabasePath() 676 680 { 681 WebCore::initializeWebCoreQt(); 677 682 if (WebCore::iconDatabase().isEnabled() && WebCore::iconDatabase().isOpen()) 678 683 return WebCore::iconDatabase().databasePath(); … … 686 691 void QWebSettings::clearIconDatabase() 687 692 { 693 WebCore::initializeWebCoreQt(); 688 694 if (WebCore::iconDatabase().isEnabled() && WebCore::iconDatabase().isOpen()) 689 695 WebCore::iconDatabase().removeAllIcons(); … … 702 708 QIcon QWebSettings::iconForUrl(const QUrl& url) 703 709 { 710 WebCore::initializeWebCoreQt(); 704 711 WebCore::Image* image = WebCore::iconDatabase().synchronousIconForPageURL(WebCore::KURL(url).string(), 705 712 WebCore::IntSize(16, 16)); … … 719 726 QWebPluginDatabase *QWebSettings::pluginDatabase() 720 727 { 728 WebCore::initializeWebCoreQt(); 721 729 static QWebPluginDatabase* database = 0; 722 730 if (!database) … … 752 760 void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap& graphic) 753 761 { 762 WebCore::initializeWebCoreQt(); 754 763 WebCore::Image::setPlatformResource(resourceNameForWebGraphic(type), graphic); 755 764 } … … 763 772 QPixmap QWebSettings::webGraphic(WebGraphic type) 764 773 { 774 WebCore::initializeWebCoreQt(); 765 775 RefPtr<WebCore::Image> img = WebCore::Image::loadPlatformResource(resourceNameForWebGraphic(type)); 766 776 if (!img) … … 780 790 void QWebSettings::clearMemoryCaches() 781 791 { 792 WebCore::initializeWebCoreQt(); 782 793 // Turn the cache on and off. Disabling the object cache will remove all 783 794 // resources from the cache. They may still live on if they are referenced … … 823 834 int QWebSettings::maximumPagesInCache() 824 835 { 836 WebCore::initializeWebCoreQt(); 825 837 return WebCore::pageCache()->capacity(); 826 838 } … … 844 856 void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity) 845 857 { 858 WebCore::initializeWebCoreQt(); 846 859 bool disableCache = !cacheMinDeadCapacity && !cacheMaxDead && !totalCapacity; 847 860 WebCore::memoryCache()->setDisabled(disableCache); … … 969 982 void QWebSettings::setOfflineStoragePath(const QString& path) 970 983 { 984 WebCore::initializeWebCoreQt(); 971 985 #if ENABLE(SQL_DATABASE) 972 986 WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(path); … … 984 998 QString QWebSettings::offlineStoragePath() 985 999 { 1000 WebCore::initializeWebCoreQt(); 986 1001 #if ENABLE(SQL_DATABASE) 987 1002 return WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); … … 1036 1051 void QWebSettings::setOfflineWebApplicationCachePath(const QString& path) 1037 1052 { 1053 WebCore::initializeWebCoreQt(); 1038 1054 WebCore::cacheStorage().setCacheDirectory(path); 1039 1055 } … … 1049 1065 QString QWebSettings::offlineWebApplicationCachePath() 1050 1066 { 1067 WebCore::initializeWebCoreQt(); 1051 1068 return WebCore::cacheStorage().cacheDirectory(); 1052 1069 } … … 1060 1077 void QWebSettings::setOfflineWebApplicationCacheQuota(qint64 maximumSize) 1061 1078 { 1079 WebCore::initializeWebCoreQt(); 1062 1080 WebCore::cacheStorage().empty(); 1063 1081 WebCore::cacheStorage().vacuumDatabaseFile(); … … 1072 1090 qint64 QWebSettings::offlineWebApplicationCacheQuota() 1073 1091 { 1092 WebCore::initializeWebCoreQt(); 1074 1093 return WebCore::cacheStorage().maximumSize(); 1075 1094 } … … 1120 1139 void QWebSettings::enablePersistentStorage(const QString& path) 1121 1140 { 1141 WebCore::initializeWebCoreQt(); 1122 1142 #ifndef QT_NO_DESKTOPSERVICES 1123 1143 QString storagePath; -
trunk/Source/WebKit/qt/ChangeLog
r101456 r101477 1 2011-11-30 Andrew Wason <rectalogic@rectalogic.com> 2 3 Replace Qt QThread threading back-end with pthread/Win32 threading back-ends 4 https://bugs.webkit.org/show_bug.cgi?id=72155 5 6 Reviewed by Simon Hausmann. 7 8 Extract WebCore initialization out of QWebPagePrivate into a 9 separate initialization function. This also needs to be called 10 from public static QWebSettings methods that call into WebCore, 11 since those can be used before a QWebPage has been constructed. 12 13 * Api/qwebpage.cpp: 14 (QWebPagePrivate::QWebPagePrivate): 15 * Api/qwebsettings.cpp: 16 (QWebSettings::globalSettings): 17 (QWebSettings::setIconDatabasePath): 18 (QWebSettings::iconDatabasePath): 19 (QWebSettings::clearIconDatabase): 20 (QWebSettings::iconForUrl): 21 (QWebSettings::setWebGraphic): 22 (QWebSettings::webGraphic): 23 (QWebSettings::clearMemoryCaches): 24 (QWebSettings::maximumPagesInCache): 25 (QWebSettings::setObjectCacheCapacities): 26 (QWebSettings::setOfflineStoragePath): 27 (QWebSettings::offlineStoragePath): 28 (QWebSettings::setOfflineWebApplicationCachePath): 29 (QWebSettings::offlineWebApplicationCachePath): 30 (QWebSettings::setOfflineWebApplicationCacheQuota): 31 (QWebSettings::offlineWebApplicationCacheQuota): 32 (QWebSettings::enablePersistentStorage): 33 * WebCoreSupport/InitWebCoreQt.cpp: Added. 34 (WebCore::initializeWebCoreQt): 35 * WebCoreSupport/InitWebCoreQt.h: Added. 36 1 37 2011-11-30 Adenilson Cavalcanti <adenilson.silva@openbossa.org> 2 38 -
trunk/Source/WebKit2/ChangeLog
r101470 r101477 1 2011-11-30 Simon Hausmann <simon.hausmann@nokia.com> 2 3 Build fix. The removal of the Qt threading back-end also removed 4 an implicit QString inclusion/forward-declaration. 5 6 * UIProcess/qt/QtWebContext.h: 7 1 8 2011-11-30 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 9 -
trunk/Source/WebKit2/UIProcess/qt/QtWebContext.h
r101195 r101477 26 26 #include <wtf/RefCounted.h> 27 27 #include <wtf/RefPtr.h> 28 #include <qglobal.h> 29 30 QT_BEGIN_NAMESPACE 31 class QString; 32 QT_END_NAMESPACE 28 33 29 34 namespace WebKit { -
trunk/Source/api.pri
r101262 r101477 53 53 $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \ 54 54 $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \ 55 $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp \ 55 56 $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \ 56 57 $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \ … … 64 65 65 66 HEADERS += \ 67 $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.h \ 66 68 $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \ 67 69 $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
Note: See TracChangeset
for help on using the changeset viewer.