summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/wtf
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
commit03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch)
tree52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/JavaScriptCore/wtf
parentcd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff)
downloadqtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/JavaScriptCore/wtf')
-rw-r--r--Source/JavaScriptCore/wtf/BitVector.cpp2
-rw-r--r--Source/JavaScriptCore/wtf/BitVector.h7
-rw-r--r--Source/JavaScriptCore/wtf/CurrentTime.cpp6
-rw-r--r--Source/JavaScriptCore/wtf/FastAllocBase.h2
-rw-r--r--Source/JavaScriptCore/wtf/HashTable.h3
-rw-r--r--Source/JavaScriptCore/wtf/Platform.h12
-rw-r--r--Source/JavaScriptCore/wtf/ThreadSpecific.h32
-rw-r--r--Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp16
8 files changed, 32 insertions, 48 deletions
diff --git a/Source/JavaScriptCore/wtf/BitVector.cpp b/Source/JavaScriptCore/wtf/BitVector.cpp
index 49dc21129..863a5703a 100644
--- a/Source/JavaScriptCore/wtf/BitVector.cpp
+++ b/Source/JavaScriptCore/wtf/BitVector.cpp
@@ -105,7 +105,6 @@ void BitVector::resizeOutOfLine(size_t numBits)
m_bitsOrPointer = bitwise_cast<uintptr_t>(newOutOfLineBits) >> 1;
}
-#ifndef NDEBUG
void BitVector::dump(FILE* out)
{
for (size_t i = 0; i < size(); ++i) {
@@ -115,6 +114,5 @@ void BitVector::dump(FILE* out)
fprintf(out, "-");
}
}
-#endif
} // namespace WTF
diff --git a/Source/JavaScriptCore/wtf/BitVector.h b/Source/JavaScriptCore/wtf/BitVector.h
index 109d3ffcf..335656c40 100644
--- a/Source/JavaScriptCore/wtf/BitVector.h
+++ b/Source/JavaScriptCore/wtf/BitVector.h
@@ -26,13 +26,10 @@
#ifndef BitVector_h
#define BitVector_h
+#include <stdio.h>
#include <wtf/Assertions.h>
#include <wtf/StdLibExtras.h>
-#ifndef NDEBUG
-#include <stdio.h>
-#endif
-
namespace WTF {
// This is a space-efficient, resizeable bitvector class. In the common case it
@@ -165,9 +162,7 @@ public:
clear(bit);
}
-#ifndef NDEBUG
void dump(FILE* out);
-#endif
private:
static unsigned bitsInPointer()
diff --git a/Source/JavaScriptCore/wtf/CurrentTime.cpp b/Source/JavaScriptCore/wtf/CurrentTime.cpp
index c8c77f54f..1ebd084d8 100644
--- a/Source/JavaScriptCore/wtf/CurrentTime.cpp
+++ b/Source/JavaScriptCore/wtf/CurrentTime.cpp
@@ -56,8 +56,6 @@ extern "C" time_t mktime(struct tm *t);
#endif
#endif
-#elif PLATFORM(GTK)
-#include <glib.h>
#elif PLATFORM(WX)
#include <wx/datetime.h>
#elif PLATFORM(EFL)
@@ -66,6 +64,10 @@ extern "C" time_t mktime(struct tm *t);
#include <sys/time.h>
#endif
+#if PLATFORM(GTK)
+#include <glib.h>
+#endif
+
#if PLATFORM(QT)
#include <QElapsedTimer>
#endif
diff --git a/Source/JavaScriptCore/wtf/FastAllocBase.h b/Source/JavaScriptCore/wtf/FastAllocBase.h
index 1edbed94d..b9ab0cab1 100644
--- a/Source/JavaScriptCore/wtf/FastAllocBase.h
+++ b/Source/JavaScriptCore/wtf/FastAllocBase.h
@@ -129,7 +129,7 @@ public: \
return location; \
} \
private: \
-typedef int ThisIsHereToForceASemicolonAfterThisMacro
+typedef int __thisIsHereToForceASemicolonAfterThisMacro
namespace WTF {
diff --git a/Source/JavaScriptCore/wtf/HashTable.h b/Source/JavaScriptCore/wtf/HashTable.h
index 44f914330..cbcc09817 100644
--- a/Source/JavaScriptCore/wtf/HashTable.h
+++ b/Source/JavaScriptCore/wtf/HashTable.h
@@ -478,7 +478,8 @@ namespace WTF {
return;
ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));
AlignedBuffer<sizeof(ValueType), WTF_ALIGN_OF(ValueType)> deletedValueBuffer;
- ValueType& deletedValue = *reinterpret_cast_ptr<ValueType*>(deletedValueBuffer.buffer);
+ ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(deletedValueBuffer.buffer);
+ ValueType& deletedValue = *deletedValuePtr;
Traits::constructDeletedValue(deletedValue);
ASSERT(!HashTranslator::equal(Extractor::extract(deletedValue), key));
}
diff --git a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h
index cecd5ddcd..e6d43dac3 100644
--- a/Source/JavaScriptCore/wtf/Platform.h
+++ b/Source/JavaScriptCore/wtf/Platform.h
@@ -859,10 +859,6 @@
#define ENABLE_GEOLOCATION 0
#endif
-#if !defined(ENABLE_GESTURE_RECOGNIZER)
-#define ENABLE_GESTURE_RECOGNIZER 0
-#endif
-
#if !defined(ENABLE_VIEWPORT)
#define ENABLE_VIEWPORT 0
#endif
@@ -1113,7 +1109,11 @@
since most ports try to support sub-project independence, adding new headers
to WTF causes many ports to break, and so this way we can address the build
breakages one port at a time. */
+#if PLATFORM(MAC) || PLATFORM(QT)
+#define WTF_USE_EXPORT_MACROS 1
+#else
#define WTF_USE_EXPORT_MACROS 0
+#endif
#if (PLATFORM(QT) && !OS(DARWIN)) || PLATFORM(GTK) || PLATFORM(EFL)
#define WTF_USE_UNIX_DOMAIN_SOCKETS 1
@@ -1137,6 +1137,10 @@
#define WTF_USE_AVFOUNDATION 1
#endif
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
+#define WTF_USE_COREMEDIA 1
+#endif
+
#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(QT)
#define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1
#endif
diff --git a/Source/JavaScriptCore/wtf/ThreadSpecific.h b/Source/JavaScriptCore/wtf/ThreadSpecific.h
index 7c75a83ee..242acc0d3 100644
--- a/Source/JavaScriptCore/wtf/ThreadSpecific.h
+++ b/Source/JavaScriptCore/wtf/ThreadSpecific.h
@@ -46,8 +46,6 @@
#if USE(PTHREADS)
#include <pthread.h>
-#elif PLATFORM(GTK)
-#include <glib.h>
#elif OS(WINDOWS)
#include <windows.h>
#endif
@@ -100,8 +98,6 @@ private:
#if USE(PTHREADS)
pthread_key_t m_key;
-#elif PLATFORM(GTK)
- GStaticPrivate m_key;
#elif OS(WINDOWS)
int m_index;
#endif
@@ -130,29 +126,6 @@ inline void ThreadSpecific<T>::set(T* ptr)
pthread_setspecific(m_key, new Data(ptr, this));
}
-#elif PLATFORM(GTK)
-
-template<typename T>
-inline ThreadSpecific<T>::ThreadSpecific()
-{
- g_static_private_init(&m_key);
-}
-
-template<typename T>
-inline T* ThreadSpecific<T>::get()
-{
- Data* data = static_cast<Data*>(g_static_private_get(&m_key));
- return data ? data->value : 0;
-}
-
-template<typename T>
-inline void ThreadSpecific<T>::set(T* ptr)
-{
- ASSERT(!get());
- Data* data = new Data(ptr, this);
- g_static_private_set(&m_key, data, destroy);
-}
-
#elif OS(WINDOWS)
// TLS_OUT_OF_INDEXES is not defined on WinCE.
@@ -218,9 +191,6 @@ inline void ThreadSpecific<T>::destroy(void* ptr)
// We want get() to keep working while data destructor works, because it can be called indirectly by the destructor.
// Some pthreads implementations zero out the pointer before calling destroy(), so we temporarily reset it.
pthread_setspecific(data->owner->m_key, ptr);
-#elif PLATFORM(GTK)
- // See comment as above
- g_static_private_set(&data->owner->m_key, data, 0);
#endif
data->value->~T();
@@ -228,8 +198,6 @@ inline void ThreadSpecific<T>::destroy(void* ptr)
#if USE(PTHREADS)
pthread_setspecific(data->owner->m_key, 0);
-#elif PLATFORM(GTK)
- g_static_private_set(&data->owner->m_key, 0, 0);
#elif OS(WINDOWS)
TlsSetValue(tlsKeys()[data->owner->m_index], 0);
#else
diff --git a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp
index 6fcd806eb..1a2a8b1f1 100644
--- a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp
+++ b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp
@@ -20,8 +20,13 @@
#include "config.h"
#include "GlibUtilities.h"
+#if OS(WINDOWS)
+#include <windows.h>
+#include <wtf/text/WTFString.h>
+#else
#include <limits.h>
#include <unistd.h>
+#endif
#if OS(LINUX)
CString getCurrentExecutablePath()
@@ -41,4 +46,15 @@ CString getCurrentExecutablePath()
return CString();
return CString(readLinkBuffer, result);
}
+#elif OS(WINDOWS)
+CString getCurrentExecutablePath()
+{
+ static WCHAR buffer[MAX_PATH];
+ DWORD length = GetModuleFileNameW(0, buffer, MAX_PATH);
+ if (!length || (length == MAX_PATH && GetLastError() == ERROR_INSUFFICIENT_BUFFER))
+ return CString();
+
+ String path(buffer, length);
+ return path.utf8();
+}
#endif