Changeset 156775 in webkit


Ignore:
Timestamp:
Oct 2, 2013 11:03:37 AM (10 years ago)
Author:
andersca@apple.com
Message:

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:
Location:
trunk/Source/WTF
Files:
3 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r156692 r156775  
     12013-10-02  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove Qt code from WTF
     4        https://bugs.webkit.org/show_bug.cgi?id=122221
     5
     6        Reviewed by Antti Koivisto.
     7
     8        I'm keeping the PLATFORM(QT) defines in Platform.h for now so we can assess if there are any
     9        Qt only features that we can remove later.
     10
     11        * WTF.pri: Removed.
     12        * WTF.pro: Removed.
     13        * wtf/Assertions.cpp:
     14        * wtf/CurrentTime.cpp:
     15        * wtf/DisallowCType.h:
     16        * wtf/FastMalloc.cpp:
     17        * wtf/FeatureDefines.h:
     18        * wtf/qt/MainThreadQt.cpp: Removed.
     19        * wtf/qt/StringQt.cpp: Removed.
     20        * wtf/text/AtomicString.h:
     21        * wtf/text/StringImpl.cpp:
     22        (WTF::StringImpl::~StringImpl):
     23        * wtf/text/StringImpl.h:
     24        * wtf/text/WTFString.cpp:
     25        (WTF::String::format):
     26        * wtf/text/WTFString.h:
     27
    1282013-09-30  Sam Weinig  <sam@webkit.org>
    229
  • trunk/Source/WTF/wtf/Assertions.cpp

    r156128 r156775  
    278278
    279279#if OS(DARWIN) || OS(LINUX)
    280 #  if PLATFORM(QT) || PLATFORM(GTK)
     280#  if PLATFORM(GTK)
    281281#    if defined(__GLIBC__) && !defined(__UCLIBC__)
    282282#      define WTF_USE_BACKTRACE_SYMBOLS 1
  • trunk/Source/WTF/wtf/CurrentTime.cpp

    r149178 r156775  
    6060#endif
    6161
    62 #if PLATFORM(QT)
    63 #include <QElapsedTimer>
    64 #endif
    65 
    6662namespace WTF {
    6763
     
    284280}
    285281
    286 #elif USE(GLIB) && !PLATFORM(EFL) && !PLATFORM(QT)
     282#elif USE(GLIB) && !PLATFORM(EFL)
    287283
    288284double monotonicallyIncreasingTime()
    289285{
    290286    return static_cast<double>(g_get_monotonic_time() / 1000000.0);
    291 }
    292 
    293 #elif PLATFORM(QT)
    294 
    295 double monotonicallyIncreasingTime()
    296 {
    297     ASSERT(QElapsedTimer::isMonotonic());
    298     static QElapsedTimer timer;
    299     return timer.nsecsElapsed() / 1.0e9;
    300287}
    301288
  • trunk/Source/WTF/wtf/DisallowCType.h

    r149178 r156775  
    4242// isacii().
    4343#include <wtf/Platform.h>
    44 #if !PLATFORM(QT) && !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
     44#if !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
    4545
    4646#include <ctype.h>
  • trunk/Source/WTF/wtf/FastMalloc.cpp

    r156596 r156775  
    108108
    109109// Harden the pointers stored in the TCMalloc linked lists
    110 #if !PLATFORM(QT)
    111110#define ENABLE_TCMALLOC_HARDENING 1
    112 #endif
    113111
    114112// Use a background thread to periodically scavenge memory to release back to the system
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r156692 r156775  
    300300#endif /* PLATFORM(GTK) */
    301301
    302 /* --------- Qt port (Unix, Windows, Mac, WinCE) --------- */
    303 #if PLATFORM(QT)
    304 
    305 #if OS(UNIX)
    306 #if !defined(ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH)
    307 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
    308 #endif
    309 #endif
    310 
    311 #endif /* PLATFORM(QT) */
    312 
    313302/* --------- Blackberry port (QNX) --------- */
    314303#if PLATFORM(BLACKBERRY)
  • trunk/Source/WTF/wtf/text/AtomicString.h

    r152816 r156775  
    150150    AtomicString(NSString* s) : m_string(add((CFStringRef)s)) { }
    151151    operator NSString*() const { return m_string; }
    152 #endif
    153 #if PLATFORM(QT)
    154     AtomicString(const QString& s) : m_string(add(String(s).impl())) { }
    155     operator QString() const { return m_string; }
    156152#endif
    157153#if PLATFORM(BLACKBERRY)
  • trunk/Source/WTF/wtf/text/StringImpl.cpp

    r153686 r156775  
    138138        return;
    139139    }
    140 #if PLATFORM(QT)
    141     if (ownership == BufferAdoptedQString) {
    142         if (!m_qStringData->ref.deref())
    143             QStringData::deallocate(m_qStringData);
    144         return;
    145     }
    146 #endif
    147140
    148141    ASSERT(ownership == BufferSubstring);
     
    19331926}
    19341927
    1935 #if PLATFORM(QT)
    1936 PassRefPtr<StringImpl> StringImpl::adopt(QStringData* qStringData)
    1937 {
    1938     ASSERT(qStringData);
    1939 
    1940     if (!qStringData->size)
    1941         return empty();
    1942 
    1943     return adoptRef(new StringImpl(qStringData, ConstructAdoptedQString));
    1944 }
    1945 #endif
    1946 
    19471928size_t StringImpl::sizeInBytes() const
    19481929{
  • trunk/Source/WTF/wtf/text/StringImpl.h

    r155563 r156775  
    3535#include <wtf/text/ConversionMode.h>
    3636#include <wtf/unicode/Unicode.h>
    37 
    38 #if PLATFORM(QT)
    39 #include <QString>
    40 #endif
    4137
    4238#if USE(CF)
     
    160156        BufferOwned,
    161157        BufferSubstring,
    162 #if PLATFORM(QT)
    163         BufferAdoptedQString
    164 #endif
    165         // NOTE: Adding more ownership types needs to extend m_hashAndFlags as we're at capacity
    166158    };
    167159
     
    342334    }
    343335
    344 #if PLATFORM(QT)
    345     // Used to create new strings that adopt an existing QString's data
    346     enum ConstructAdoptedQStringTag { ConstructAdoptedQString };
    347     StringImpl(QStringData* qStringData, ConstructAdoptedQStringTag)
    348         : m_refCount(s_refCountIncrement)
    349         , m_length(qStringData->size)
    350         , m_data16(0)
    351         , m_qStringData(qStringData)
    352         , m_hashAndFlags(BufferAdoptedQString)
    353     {
    354         ASSERT(m_length);
    355 
    356         // We ref the string-data to ensure it will be valid for the lifetime of
    357         // this string. We then deref it in the destructor, so that the string
    358         // data can eventually be freed.
    359         m_qStringData->ref.ref();
    360 
    361         // Now that we have a ref we can safely reference the string data
    362         m_data16 = reinterpret_cast_ptr<const UChar*>(qStringData->data());
    363         ASSERT(m_data16);
    364 
    365         STRING_STATS_ADD_16BIT_STRING(m_length);
    366     }
    367 #endif
    368336    ~StringImpl();
    369337
     
    482450    WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&);
    483451
    484 #if PLATFORM(QT)
    485     static PassRefPtr<StringImpl> adopt(QStringData*);
    486 #endif
    487 
    488452    unsigned length() const { return m_length; }
    489453    bool is8Bit() const { return m_hashAndFlags & s_hashFlag8BitBuffer; }
     
    566530#endif
    567531
    568 #if PLATFORM(QT)
    569     QStringData* qStringData() { return bufferOwnership() == BufferAdoptedQString ? m_qStringData : 0; }
    570 #endif
    571    
    572532    static WTF_EXPORT_STRING_API CString utf8ForCharacters(const UChar* characters, unsigned length, ConversionMode = LenientConversion);
    573533    WTF_EXPORT_STRING_API CString utf8ForRange(unsigned offset, unsigned length, ConversionMode = LenientConversion) const;
     
    874834        StringImpl* m_substringBuffer;
    875835        mutable UChar* m_copyData16;
    876 #if PLATFORM(QT)
    877         QStringData* m_qStringData;
    878 #endif
    879836    };
    880837    mutable unsigned m_hashAndFlags;
  • trunk/Source/WTF/wtf/text/WTFString.cpp

    r153135 r156775  
    412412String String::format(const char *format, ...)
    413413{
    414 #if PLATFORM(QT)
    415     // Use QString::vsprintf to avoid the locale dependent formatting of vsnprintf.
    416     // https://bugs.webkit.org/show_bug.cgi?id=18994
    417     va_list args;
    418     va_start(args, format);
    419 
    420     QString buffer;
    421     buffer.vsprintf(format, args);
    422 
    423     va_end(args);
    424 
    425     QByteArray ba = buffer.toUtf8();
    426     return StringImpl::create(reinterpret_cast<const LChar*>(ba.constData()), ba.length());
    427 
    428 #elif OS(WINCE)
     414#if OS(WINCE)
    429415    va_list args;
    430416    va_start(args, format);
  • trunk/Source/WTF/wtf/text/WTFString.h

    r155115 r156775  
    3333#endif
    3434
    35 #if PLATFORM(QT)
    36 QT_BEGIN_NAMESPACE
    37 class QString;
    38 QT_END_NAMESPACE
    39 #endif
    40 
    4135#if PLATFORM(BLACKBERRY)
    4236namespace BlackBerry {
     
    352346    WTF_EXPORT_STRING_API String foldCase() const;
    353347
    354 #if !PLATFORM(QT)
    355348    WTF_EXPORT_STRING_API static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
    356 #else
    357     WTF_EXPORT_STRING_API static String format(const char *, ...);
    358 #endif
    359349
    360350    // Returns an uninitialized string. The characters needs to be written
     
    422412    // need this mapping because AppKit crashes when passed nil NSStrings.
    423413    operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
    424 #endif
    425 
    426 #if PLATFORM(QT)
    427     WTF_EXPORT_STRING_API String(const QString&);
    428     WTF_EXPORT_STRING_API String(const QStringRef&);
    429     WTF_EXPORT_STRING_API operator QString() const;
    430414#endif
    431415
Note: See TracChangeset for help on using the changeset viewer.