Remove Qt code from WTF
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 18:03:37 +0000 (18:03 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 18:03:37 +0000 (18:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122221

Reviewed by Antti Koivisto.

I'm keeping the PLATFORM(QT) defines in Platform.h for now so we can assess if there are any
Qt only features that we can remove later.

* WTF.pri: Removed.
* WTF.pro: Removed.
* wtf/Assertions.cpp:
* wtf/CurrentTime.cpp:
* wtf/DisallowCType.h:
* wtf/FastMalloc.cpp:
* wtf/FeatureDefines.h:
* wtf/qt/MainThreadQt.cpp: Removed.
* wtf/qt/StringQt.cpp: Removed.
* wtf/text/AtomicString.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::~StringImpl):
* wtf/text/StringImpl.h:
* wtf/text/WTFString.cpp:
(WTF::String::format):
* wtf/text/WTFString.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.pri [deleted file]
Source/WTF/WTF.pro [deleted file]
Source/WTF/wtf/Assertions.cpp
Source/WTF/wtf/CurrentTime.cpp
Source/WTF/wtf/DisallowCType.h
Source/WTF/wtf/FastMalloc.cpp
Source/WTF/wtf/FeatureDefines.h
Source/WTF/wtf/qt/MainThreadQt.cpp [deleted file]
Source/WTF/wtf/qt/StringQt.cpp [deleted file]
Source/WTF/wtf/text/AtomicString.h
Source/WTF/wtf/text/StringImpl.cpp
Source/WTF/wtf/text/StringImpl.h
Source/WTF/wtf/text/WTFString.cpp
Source/WTF/wtf/text/WTFString.h

index 2cf6c8b..b2dd6dc 100644 (file)
@@ -1,3 +1,30 @@
+2013-10-02  Anders Carlsson  <andersca@apple.com>
+
+        Remove Qt code from WTF
+        https://bugs.webkit.org/show_bug.cgi?id=122221
+
+        Reviewed by Antti Koivisto.
+
+        I'm keeping the PLATFORM(QT) defines in Platform.h for now so we can assess if there are any
+        Qt only features that we can remove later.
+
+        * WTF.pri: Removed.
+        * WTF.pro: Removed.
+        * wtf/Assertions.cpp:
+        * wtf/CurrentTime.cpp:
+        * wtf/DisallowCType.h:
+        * wtf/FastMalloc.cpp:
+        * wtf/FeatureDefines.h:
+        * wtf/qt/MainThreadQt.cpp: Removed.
+        * wtf/qt/StringQt.cpp: Removed.
+        * wtf/text/AtomicString.h:
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::~StringImpl):
+        * wtf/text/StringImpl.h:
+        * wtf/text/WTFString.cpp:
+        (WTF::String::format):
+        * wtf/text/WTFString.h:
+
 2013-09-30  Sam Weinig  <sam@webkit.org>
 
         Remove support for DOMFileSystem
diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
deleted file mode 100644 (file)
index d34faa3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# -------------------------------------------------------------------
-# This file contains shared rules used both when building WTF itself
-# and for targets that depend in some way on WTF.
-#
-# See 'Tools/qmake/README' for an overview of the build system
-# -------------------------------------------------------------------
-
-# All external modules should include WTF headers by prefixing with "wtf" (#include <wtf/some/thing.h>).
-INCLUDEPATH += $$PWD
-
-mac {
-    # Mac OS does ship libicu but not the associated header files.
-    # Therefore WebKit provides adequate header files.
-    INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu
-    LIBS += -licucore
-} else {
-    contains(QT_CONFIG,icu) {
-        win32: LIBS += -licuin -licuuc -licudt
-        else: LIBS += -licui18n -licuuc -licudata
-    }
-}
-
-linux-*:use?(GSTREAMER) {
-    DEFINES += WTF_USE_GLIB=1
-    PKGCONFIG += glib-2.0 gio-2.0
-}
-
-win32-* {
-    LIBS += -lwinmm
-    LIBS += -lgdi32
-} else {
-    LIBS += -lz
-}
-
-qnx {
-    # required for timegm
-    LIBS += -lnbutil
-}
-
-mac {
-    LIBS += -framework AppKit
-}
-
-# MSVC is lacking stdint.h as well as inttypes.h.
-win32-msvc*|win32-icc|wince*: INCLUDEPATH += $$ROOT_WEBKIT_DIR/Source/JavaScriptCore/os-win32
diff --git a/Source/WTF/WTF.pro b/Source/WTF/WTF.pro
deleted file mode 100644 (file)
index b59a386..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-# -------------------------------------------------------------------
-# Project file for WTF
-#
-# See 'Tools/qmake/README' for an overview of the build system
-# -------------------------------------------------------------------
-TEMPLATE = lib
-TARGET = WTF
-
-include(WTF.pri)
-
-CONFIG += staticlib
-
-VPATH += $$PWD/wtf
-
-INCLUDEPATH += $$PWD/wtf
-
-wince* {
-    # for mt19937ar.c
-    INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/ThirdParty
-}
-
-HEADERS += \
-    ASCIICType.h \
-    Assertions.h \
-    Atomics.h \
-    AVLTree.h \
-    Bitmap.h \
-    BitArray.h \
-    BitVector.h \
-    BloomFilter.h \
-    BoundsCheckedPointer.h \
-    BumpPointerAllocator.h \
-    ByteOrder.h \
-    CheckedArithmetic.h \
-    Compiler.h \
-    Compression.h \
-    CryptographicallyRandomNumber.h \
-    CurrentTime.h \
-    DateMath.h \
-    DecimalNumber.h \
-    Decoder.h \
-    DataLog.h \ 
-    Deque.h \
-    DisallowCType.h \
-    dtoa.h \
-    dtoa/bignum-dtoa.h \
-    dtoa/bignum.h \
-    dtoa/cached-powers.h \
-    dtoa/diy-fp.h \
-    dtoa/double-conversion.h \
-    dtoa/double.h \
-    dtoa/fast-dtoa.h \
-    dtoa/fixed-dtoa.h \
-    dtoa/strtod.h \
-    dtoa/utils.h \
-    DynamicAnnotations.h \
-    Encoder.h \
-    EnumClass.h \
-    ExportMacros.h \
-    FastMalloc.h \
-    FeatureDefines.h \
-    FilePrintStream.h \
-    FixedArray.h \
-    Forward.h \
-    FunctionDispatcher.h \
-    Functional.h \
-    GetPtr.h \
-    GregorianDateTime.h \
-    HashCountedSet.h \
-    HashFunctions.h \
-    HashIterators.h \
-    HashMap.h \
-    HashSet.h \
-    HashTable.h \
-    HashTraits.h \
-    HexNumber.h \
-    ListHashSet.h \
-    Locker.h \
-    MainThread.h \
-    MallocPtr.h \
-    MathExtras.h \
-    MD5.h \
-    MediaTime.h \
-    MessageQueue.h \
-    MetaAllocator.h \
-    MetaAllocatorHandle.h \
-    Ref.h \
-    Noncopyable.h \
-    NumberOfCores.h \
-    RAMSize.h \
-    OSAllocator.h \
-    OSRandomSource.h \
-    OwnPtr.h \
-    OwnPtrCommon.h \
-    PackedIntVector.h \
-    PageAllocation.h \
-    PageAllocationAligned.h \
-    PageBlock.h \
-    PageReservation.h \
-    ParallelJobs.h \
-    ParallelJobsGeneric.h \
-    ParallelJobsLibdispatch.h \
-    ParallelJobsOpenMP.h \
-    PassOwnPtr.h \
-    PassRefPtr.h \
-    Platform.h \
-    PossiblyNull.h \
-    PrintStream.h \
-    ProcessID.h \
-    RandomNumber.h \
-    RandomNumberSeed.h \
-    RawPointer.h \
-    RedBlackTree.h \
-    RefCounted.h \
-    RefCountedLeakCounter.h \
-    RefPtr.h \
-    RefPtrHashMap.h \
-    RetainPtr.h \
-    SHA1.h \
-    SaturatedArithmetic.h \
-    Spectrum.h \
-    StackBounds.h \
-    StaticConstructors.h \
-    StdLibExtras.h \
-    StringExtras.h \
-    StringHasher.h \
-    StringPrintStream.h \
-    TCPackedCache.h \
-    TCSpinLock.h \
-    TCSystemAlloc.h \
-    text/ASCIIFastPath.h \
-    text/AtomicString.h \
-    text/AtomicStringHash.h \
-    text/AtomicStringImpl.h \
-    text/AtomicStringTable.h \
-    text/Base64.h \
-    text/CString.h \
-    text/IntegerToStringConversion.h \
-    text/StringBuffer.h \
-    text/StringBuilder.h \
-    text/StringConcatenate.h \
-    text/StringHash.h \
-    text/StringImpl.h \
-    text/StringOperators.h \
-    text/TextPosition.h \
-    text/WTFString.h \
-    threads/BinarySemaphore.h \
-    Threading.h \
-    ThreadingPrimitives.h \
-    ThreadRestrictionVerifier.h \
-    ThreadSafeRefCounted.h \
-    ThreadSpecific.h \
-    unicode/CharacterNames.h \
-    unicode/Collator.h \
-    unicode/icu/UnicodeIcu.h \
-    unicode/ScriptCodesFromICU.h \
-    unicode/Unicode.h \
-    unicode/UnicodeMacrosFromICU.h \
-    unicode/UTF8.h \
-    ValueCheck.h \
-    Vector.h \
-    VectorTraits.h \
-    VMTags.h \
-    WTFThreadData.h \
-    WeakPtr.h
-
-unix: HEADERS += ThreadIdentifierDataPthreads.h
-
-SOURCES += \
-    Assertions.cpp \
-    Atomics.cpp \
-    BitVector.cpp \
-    CompilationThread.cpp \
-    Compression.cpp \
-    CryptographicallyRandomNumber.cpp \
-    CurrentTime.cpp \
-    DateMath.cpp \
-    DataLog.cpp \
-    DecimalNumber.cpp \
-    dtoa.cpp \
-    dtoa/bignum-dtoa.cc \
-    dtoa/bignum.cc \
-    dtoa/cached-powers.cc \
-    dtoa/diy-fp.cc \
-    dtoa/double-conversion.cc \
-    dtoa/fast-dtoa.cc \
-    dtoa/fixed-dtoa.cc \
-    dtoa/strtod.cc \
-    FastMalloc.cpp \
-    FilePrintStream.cpp \
-    FunctionDispatcher.cpp \
-    GregorianDateTime.cpp \
-    gobject/GOwnPtr.cpp \
-    gobject/GRefPtr.cpp \
-    HashTable.cpp \
-    MD5.cpp \
-    MainThread.cpp \
-    MediaTime.cpp \
-    MetaAllocator.cpp \
-    NumberOfCores.cpp \
-    RAMSize.cpp \
-    OSRandomSource.cpp \
-    qt/MainThreadQt.cpp \
-    qt/StringQt.cpp \
-    PageAllocationAligned.cpp \
-    PageBlock.cpp \
-    ParallelJobsGeneric.cpp \
-    PrintStream.cpp \
-    RandomNumber.cpp \
-    RefCountedLeakCounter.cpp \
-    SHA1.cpp \
-    SixCharacterHash.cpp \
-    StackBounds.cpp \
-    StringPrintStream.cpp \
-    TCSystemAlloc.cpp \
-    Threading.cpp \
-    WTFThreadData.cpp \
-    text/AtomicString.cpp \
-    text/AtomicStringTable.cpp \
-    text/Base64.cpp \
-    text/CString.cpp \
-    text/StringBuilder.cpp \
-    text/StringImpl.cpp \
-    text/StringStatics.cpp \
-    text/WTFString.cpp \
-    unicode/CollatorDefault.cpp \
-    unicode/icu/CollatorICU.cpp \
-    unicode/UTF8.cpp
-
-unix: SOURCES += \
-    OSAllocatorPosix.cpp \
-    ThreadIdentifierDataPthreads.cpp \
-    ThreadingPthreads.cpp
-
-win*|wince*: SOURCES += \
-    OSAllocatorWin.cpp \
-    ThreadSpecificWin.cpp \
-    ThreadingWin.cpp
-
-win32 {
-    SOURCES += \
-        threads/win/BinarySemaphoreWin.cpp
-    INCLUDEPATH += $$PWD/wtf/threads
-} else {
-    SOURCES += \
-        threads/BinarySemaphore.cpp
-}
-
-QT += core
-QT -= gui
-
-*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2
-*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3
-
-*sh4* {
-    QMAKE_CXXFLAGS += -mieee -w
-    QMAKE_CFLAGS   += -mieee -w
-}
-
-*-g++*:lessThan(QT_GCC_MAJOR_VERSION, 5):lessThan(QT_GCC_MINOR_VERSION, 6) {
-    # For GCC 4.5 and before we disable C++0x mode in JSC for if enabled in Qt's mkspec
-    QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11
-}
-
index d30c124..aa902c6 100644 (file)
@@ -277,7 +277,7 @@ void WTFReportBacktrace()
 }
 
 #if OS(DARWIN) || OS(LINUX)
-#  if PLATFORM(QT) || PLATFORM(GTK)
+#  if PLATFORM(GTK)
 #    if defined(__GLIBC__) && !defined(__UCLIBC__)
 #      define WTF_USE_BACKTRACE_SYMBOLS 1
 #    endif
index 627d255..55e2ab3 100644 (file)
 #include <glib.h>
 #endif
 
-#if PLATFORM(QT)
-#include <QElapsedTimer>
-#endif
-
 namespace WTF {
 
 #if OS(WINDOWS)
@@ -283,22 +279,13 @@ double monotonicallyIncreasingTime()
     return ecore_time_get();
 }
 
-#elif USE(GLIB) && !PLATFORM(EFL) && !PLATFORM(QT)
+#elif USE(GLIB) && !PLATFORM(EFL)
 
 double monotonicallyIncreasingTime()
 {
     return static_cast<double>(g_get_monotonic_time() / 1000000.0);
 }
 
-#elif PLATFORM(QT)
-
-double monotonicallyIncreasingTime()
-{
-    ASSERT(QElapsedTimer::isMonotonic());
-    static QElapsedTimer timer;
-    return timer.nsecsElapsed() / 1.0e9;
-}
-
 #elif OS(QNX)
 
 double monotonicallyIncreasingTime()
index c3cc078..89fc170 100644 (file)
@@ -41,7 +41,7 @@
 // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
 // isacii(). 
 #include <wtf/Platform.h>
-#if !PLATFORM(QT) && !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
+#if !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
 
 #include <ctype.h>
 
index 000abf6..5b29555 100644 (file)
 #endif
 
 // Harden the pointers stored in the TCMalloc linked lists
-#if !PLATFORM(QT)
 #define ENABLE_TCMALLOC_HARDENING 1
-#endif
 
 // Use a background thread to periodically scavenge memory to release back to the system
 #if PLATFORM(IOS)
index bb18210..1330f99 100644 (file)
 
 #endif /* PLATFORM(GTK) */
 
-/* --------- Qt port (Unix, Windows, Mac, WinCE) --------- */
-#if PLATFORM(QT)
-
-#if OS(UNIX)
-#if !defined(ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH)
-#define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
-#endif
-#endif
-
-#endif /* PLATFORM(QT) */
-
 /* --------- Blackberry port (QNX) --------- */
 #if PLATFORM(BLACKBERRY)
 
diff --git a/Source/WTF/wtf/qt/MainThreadQt.cpp b/Source/WTF/wtf/qt/MainThreadQt.cpp
deleted file mode 100644 (file)
index 606a719..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2007 Staikos Computing Services Inc.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MainThread.h"
-
-#include <QCoreApplication>
-#include <QEvent>
-#include <QObject>
-#include <QThread>
-
-namespace WTF {
-
-static int s_mainThreadInvokerEventType;
-
-class MainThreadInvoker : public QObject {
-    Q_OBJECT
-public:
-    MainThreadInvoker();
-    virtual bool event(QEvent*);
-};
-
-MainThreadInvoker::MainThreadInvoker()
-{
-    s_mainThreadInvokerEventType = QEvent::registerEventType();
-}
-
-bool MainThreadInvoker::event(QEvent* e)
-{
-    if (e->type() != s_mainThreadInvokerEventType)
-        return QObject::event(e);
-
-    dispatchFunctionsFromMainThread();
-    return true;
-}
-
-Q_GLOBAL_STATIC(MainThreadInvoker, webkit_main_thread_invoker)
-
-void initializeMainThreadPlatform()
-{
-    webkit_main_thread_invoker();
-}
-
-void scheduleDispatchFunctionsOnMainThread()
-{
-    QCoreApplication::postEvent(webkit_main_thread_invoker(), new QEvent(static_cast<QEvent::Type>(s_mainThreadInvokerEventType)));
-}
-
-} // namespace WTF
-
-#include "MainThreadQt.moc"
diff --git a/Source/WTF/wtf/qt/StringQt.cpp b/Source/WTF/wtf/qt/StringQt.cpp
deleted file mode 100644 (file)
index 4f1e939..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-
-#include <wtf/StdLibExtras.h>
-#include <wtf/text/WTFString.h>
-
-#include <QString>
-
-namespace WTF {
-
-// String conversions
-String::String(const QString& qstr)
-{
-    if (qstr.isNull())
-        return;
-    m_impl = StringImpl::adopt(const_cast<QString&>(qstr).data_ptr());
-}
-
-String::String(const QStringRef& ref)
-{
-    if (!ref.string())
-        return;
-    m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(ref.unicode()), ref.length());
-}
-
-String::operator QString() const
-{
-    if (!m_impl)
-        return QString();
-
-    if (QStringData* qStringData = m_impl->qStringData()) {
-        // The WTF string was adopted from a QString at some point, so we
-        // can just adopt the QStringData like a regular QString copy.
-        qStringData->ref.ref();
-        QStringDataPtr qStringDataPointer = { qStringData };
-        return QString(qStringDataPointer);
-    }
-
-    if (is8Bit() && !m_impl->has16BitShadow()) {
-        // Asking for characters() of an 8-bit string will make a 16-bit copy internally
-        // in WTF::String. Since we're going to copy the data to QStringData anyways, we
-        // can do the conversion ourselves and save one copy.
-        return QString::fromLatin1(reinterpret_cast<const char*>(characters8()), length());
-    }
-
-    return QString(reinterpret_cast<const QChar*>(characters()), length());
-}
-
-}
-
-// vim: ts=4 sw=4 et
index a63d6c0..2a78110 100644 (file)
@@ -150,10 +150,6 @@ public:
     AtomicString(NSString* s) : m_string(add((CFStringRef)s)) { }
     operator NSString*() const { return m_string; }
 #endif
-#if PLATFORM(QT)
-    AtomicString(const QString& s) : m_string(add(String(s).impl())) { }
-    operator QString() const { return m_string; }
-#endif
 #if PLATFORM(BLACKBERRY)
     AtomicString(const BlackBerry::Platform::String& s) : m_string(add(String(s).impl())) { }
     operator BlackBerry::Platform::String() const { return m_string; }
index da9ec41..11fa103 100644 (file)
@@ -137,13 +137,6 @@ StringImpl::~StringImpl()
         fastFree(const_cast<LChar*>(m_data8));
         return;
     }
-#if PLATFORM(QT)
-    if (ownership == BufferAdoptedQString) {
-        if (!m_qStringData->ref.deref())
-            QStringData::deallocate(m_qStringData);
-        return;
-    }
-#endif
 
     ASSERT(ownership == BufferSubstring);
     ASSERT(m_substringBuffer);
@@ -1932,18 +1925,6 @@ PassRefPtr<StringImpl> StringImpl::adopt(StringBuffer<UChar>& buffer)
     return adoptRef(new StringImpl(buffer.release(), length));
 }
 
-#if PLATFORM(QT)
-PassRefPtr<StringImpl> StringImpl::adopt(QStringData* qStringData)
-{
-    ASSERT(qStringData);
-
-    if (!qStringData->size)
-        return empty();
-
-    return adoptRef(new StringImpl(qStringData, ConstructAdoptedQString));
-}
-#endif
-
 size_t StringImpl::sizeInBytes() const
 {
     // FIXME: support substrings
index bf1f3ea..8766612 100644 (file)
 #include <wtf/text/ConversionMode.h>
 #include <wtf/unicode/Unicode.h>
 
-#if PLATFORM(QT)
-#include <QString>
-#endif
-
 #if USE(CF)
 typedef const struct __CFString * CFStringRef;
 #endif
@@ -159,10 +155,6 @@ private:
         BufferInternal,
         BufferOwned,
         BufferSubstring,
-#if PLATFORM(QT)
-        BufferAdoptedQString
-#endif
-        // NOTE: Adding more ownership types needs to extend m_hashAndFlags as we're at capacity
     };
 
     // Used to construct static strings, which have an special refCount that can never hit zero.
@@ -341,30 +333,6 @@ private:
         STRING_STATS_ADD_16BIT_STRING(m_length);
     }
 
-#if PLATFORM(QT)
-    // Used to create new strings that adopt an existing QString's data
-    enum ConstructAdoptedQStringTag { ConstructAdoptedQString };
-    StringImpl(QStringData* qStringData, ConstructAdoptedQStringTag)
-        : m_refCount(s_refCountIncrement)
-        , m_length(qStringData->size)
-        , m_data16(0)
-        , m_qStringData(qStringData)
-        , m_hashAndFlags(BufferAdoptedQString)
-    {
-        ASSERT(m_length);
-
-        // We ref the string-data to ensure it will be valid for the lifetime of
-        // this string. We then deref it in the destructor, so that the string
-        // data can eventually be freed.
-        m_qStringData->ref.ref();
-
-        // Now that we have a ref we can safely reference the string data
-        m_data16 = reinterpret_cast_ptr<const UChar*>(qStringData->data());
-        ASSERT(m_data16);
-
-        STRING_STATS_ADD_16BIT_STRING(m_length);
-    }
-#endif
     ~StringImpl();
 
 public:
@@ -481,10 +449,6 @@ public:
     WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<UChar>&);
     WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&);
 
-#if PLATFORM(QT)
-    static PassRefPtr<StringImpl> adopt(QStringData*);
-#endif
-
     unsigned length() const { return m_length; }
     bool is8Bit() const { return m_hashAndFlags & s_hashFlag8BitBuffer; }
 
@@ -565,10 +529,6 @@ public:
     bool isSubString() const { return  bufferOwnership() == BufferSubstring; }
 #endif
 
-#if PLATFORM(QT)
-    QStringData* qStringData() { return bufferOwnership() == BufferAdoptedQString ? m_qStringData : 0; }
-#endif
-    
     static WTF_EXPORT_STRING_API CString utf8ForCharacters(const UChar* characters, unsigned length, ConversionMode = LenientConversion);
     WTF_EXPORT_STRING_API CString utf8ForRange(unsigned offset, unsigned length, ConversionMode = LenientConversion) const;
     WTF_EXPORT_STRING_API CString utf8(ConversionMode = LenientConversion) const;
@@ -873,9 +833,6 @@ private:
         void* m_buffer;
         StringImpl* m_substringBuffer;
         mutable UChar* m_copyData16;
-#if PLATFORM(QT)
-        QStringData* m_qStringData;
-#endif
     };
     mutable unsigned m_hashAndFlags;
 };
index 5ae5699..dda0567 100644 (file)
@@ -411,21 +411,7 @@ Vector<UChar> String::charactersWithNullTermination() const
 
 String String::format(const char *format, ...)
 {
-#if PLATFORM(QT)
-    // Use QString::vsprintf to avoid the locale dependent formatting of vsnprintf.
-    // https://bugs.webkit.org/show_bug.cgi?id=18994
-    va_list args;
-    va_start(args, format);
-
-    QString buffer;
-    buffer.vsprintf(format, args);
-
-    va_end(args);
-
-    QByteArray ba = buffer.toUtf8();
-    return StringImpl::create(reinterpret_cast<const LChar*>(ba.constData()), ba.length());
-
-#elif OS(WINCE)
+#if OS(WINCE)
     va_list args;
     va_start(args, format);
 
index c8397ce..d031f62 100644 (file)
 #include <objc/objc.h>
 #endif
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QString;
-QT_END_NAMESPACE
-#endif
-
 #if PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
@@ -351,11 +345,7 @@ public:
     // Return the string with case folded for case insensitive comparison.
     WTF_EXPORT_STRING_API String foldCase() const;
 
-#if !PLATFORM(QT)
     WTF_EXPORT_STRING_API static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
-#else
-    WTF_EXPORT_STRING_API static String format(const char *, ...);
-#endif
 
     // Returns an uninitialized string. The characters needs to be written
     // into the buffer returned in data before the returned string is used.
@@ -423,12 +413,6 @@ public:
     operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
 #endif
 
-#if PLATFORM(QT)
-    WTF_EXPORT_STRING_API String(const QString&);
-    WTF_EXPORT_STRING_API String(const QStringRef&);
-    WTF_EXPORT_STRING_API operator QString() const;
-#endif
-
 #if PLATFORM(BLACKBERRY)
     String(const BlackBerry::Platform::String&);
     operator BlackBerry::Platform::String() const;