diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:08:55 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:08:55 +0200 |
commit | fa25f595d2719ba992bb7224fa917936c319576a (patch) | |
tree | 8181df8c67b8785d09601e363194e24ff39a6fee /Source/WTF | |
parent | fee30a7c5fe9670a98aec69c74ea1c82e84bdcbd (diff) | |
download | qtwebkit-fa25f595d2719ba992bb7224fa917936c319576a.tar.gz |
Imported WebKit commit 70459ce66c8e0409df4dd93438b9ee115c63874b (http://svn.webkit.org/repository/webkit/trunk@120815)
New snapshot with permission fix included
Diffstat (limited to 'Source/WTF')
-rw-r--r-- | Source/WTF/ChangeLog | 15 | ||||
-rw-r--r-- | Source/WTF/wtf/ExportMacros.h | 6 | ||||
-rw-r--r-- | Source/WTF/wtf/ThreadSpecific.h | 36 | ||||
-rw-r--r-- | Source/WTF/wtf/ThreadSpecificWin.cpp | 90 |
4 files changed, 7 insertions, 140 deletions
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog index b01ed25bb..175633a66 100644 --- a/Source/WTF/ChangeLog +++ b/Source/WTF/ChangeLog @@ -1,18 +1,3 @@ -2012-06-19 Joel Dillon <joel.dillon@codethink.co.uk> Jocelyn Turcotte <jocelyn.turcotte@nokia.com> - - [Qt][Win] Fix broken QtWebKit5.lib linking - https://bugs.webkit.org/show_bug.cgi?id=88321 - - Reviewed by NOBODY (OOPS!). - - Instead of letting a module's headers know which other modules depend on them, - have depending modules define explicitely that they want its symbols exported too. - - JavaScriptCore should then be compiled with both BUILDING_JavaScriptCore and - STATICALLY_LINKED_WITH_WTF. - - * wtf/ExportMacros.h: - 2012-06-17 Filip Pizlo <fpizlo@apple.com> It should be possible to look at disassembly diff --git a/Source/WTF/wtf/ExportMacros.h b/Source/WTF/wtf/ExportMacros.h index d50d6d117..efa0c8f81 100644 --- a/Source/WTF/wtf/ExportMacros.h +++ b/Source/WTF/wtf/ExportMacros.h @@ -72,7 +72,7 @@ // FIXME: When all ports are using the export macros, we should replace // WTF_EXPORTDATA with WTF_EXPORT_PRIVATE macros. -#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF) +#if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore) #define WTF_EXPORTDATA WTF_EXPORT #else #define WTF_EXPORTDATA WTF_IMPORT @@ -81,7 +81,7 @@ #else // !USE(EXPORT_MACROS) #if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !COMPILER(GCC) -#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF) +#if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore) #define WTF_EXPORTDATA __declspec(dllexport) #else #define WTF_EXPORTDATA __declspec(dllimport) @@ -98,7 +98,7 @@ #endif // USE(EXPORT_MACROS) -#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF) +#if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore) #define WTF_EXPORT_PRIVATE WTF_EXPORT #else #define WTF_EXPORT_PRIVATE WTF_IMPORT diff --git a/Source/WTF/wtf/ThreadSpecific.h b/Source/WTF/wtf/ThreadSpecific.h index 60c9907bd..f51ab4cf2 100644 --- a/Source/WTF/wtf/ThreadSpecific.h +++ b/Source/WTF/wtf/ThreadSpecific.h @@ -1,7 +1,6 @@ /* * Copyright (C) 2008 Apple Inc. All rights reserved. * Copyright (C) 2009 Jian Li <jianli@chromium.org> - * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -103,33 +102,6 @@ private: }; #if USE(PTHREADS) - -typedef pthread_key_t ThreadSpecificKey; - -inline void ThreadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *)) -{ - int error = pthread_key_create(key, destructor); - if (error) - CRASH(); -} - -inline void ThreadSpecificKeyDelete(ThreadSpecificKey key) -{ - int error = pthread_key_delete(key); - if (error) - CRASH(); -} - -inline void ThreadSpecificSet(ThreadSpecificKey key, void* value) -{ - pthread_setspecific(key, value); -} - -inline void* ThreadSpecificGet(ThreadSpecificKey key) -{ - return pthread_getspecific(key); -} - template<typename T> inline ThreadSpecific<T>::ThreadSpecific() { @@ -167,14 +139,6 @@ const int kMaxTlsKeySize = 256; WTF_EXPORT_PRIVATE long& tlsKeyCount(); WTF_EXPORT_PRIVATE DWORD* tlsKeys(); -class ThreadSpecificKeyValue; -typedef ThreadSpecificKeyValue* ThreadSpecificKey; - -void ThreadSpecificKeyCreate(ThreadSpecificKey*, void (*)(void *)); -void ThreadSpecificKeyDelete(ThreadSpecificKey); -void ThreadSpecificSet(ThreadSpecificKey, void*); -void* ThreadSpecificGet(ThreadSpecificKey); - template<typename T> inline ThreadSpecific<T>::ThreadSpecific() : m_index(-1) diff --git a/Source/WTF/wtf/ThreadSpecificWin.cpp b/Source/WTF/wtf/ThreadSpecificWin.cpp index 61a594251..d72996a7a 100644 --- a/Source/WTF/wtf/ThreadSpecificWin.cpp +++ b/Source/WTF/wtf/ThreadSpecificWin.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2009 Jian Li <jianli@chromium.org> - * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -20,72 +19,15 @@ */ #include "config.h" -#include "ThreadSpecific.h" -#include "StdLibExtras.h" -#include "ThreadingPrimitives.h" +#include "ThreadSpecific.h" -#if !USE(PTHREADS) +#if USE(PTHREADS) +#error This file should not be compiled by ports that do not use Windows native ThreadSpecific implementation. +#endif namespace WTF { -static Mutex& destructorsMutex() -{ - DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); - return staticMutex; -} - -class ThreadSpecificKeyValue { -public: - ThreadSpecificKeyValue(void (*destructor)(void *)) - : m_destructor(destructor) - { - m_tlsKey = TlsAlloc(); - if (m_tlsKey == TLS_OUT_OF_INDEXES) - CRASH(); - - MutexLocker locker(destructorsMutex()); - m_next = m_first; - m_first = this; - } - - ~ThreadSpecificKeyValue() - { - MutexLocker locker(destructorsMutex()); - ThreadSpecificKeyValue** next = &m_first; - while (*next != this) { - ASSERT(*next); - next = &(*next)->m_next; - } - *next = (*next)->m_next; - - TlsFree(m_tlsKey); - } - - void setValue(void* data) { TlsSetValue(m_tlsKey, data); } - void* value() { return TlsGetValue(m_tlsKey); } - - static void callDestructors() - { - MutexLocker locker(destructorsMutex()); - ThreadSpecificKeyValue* next = m_first; - while (next) { - if (void* data = next->value()) - next->m_destructor(data); - next = next->m_next; - } - } - -private: - void (*m_destructor)(void *); - DWORD m_tlsKey; - ThreadSpecificKeyValue* m_next; - - static ThreadSpecificKeyValue* m_first; -}; - -ThreadSpecificKeyValue* ThreadSpecificKeyValue::m_first = 0; - long& tlsKeyCount() { static long count; @@ -98,26 +40,6 @@ DWORD* tlsKeys() return keys; } -void ThreadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *)) -{ - *key = new ThreadSpecificKeyValue(destructor); -} - -void ThreadSpecificKeyDelete(ThreadSpecificKey key) -{ - delete key; -} - -void ThreadSpecificSet(ThreadSpecificKey key, void* data) -{ - key->setValue(data); -} - -void* ThreadSpecificGet(ThreadSpecificKey key) -{ - return key->value(); -} - void ThreadSpecificThreadExit() { for (long i = 0; i < tlsKeyCount(); i++) { @@ -126,10 +48,6 @@ void ThreadSpecificThreadExit() if (data) data->destructor(data); } - - ThreadSpecificKeyValue::callDestructors(); } } // namespace WTF - -#endif // !USE(PTHREADS) |