Changeset 53995 in webkit


Ignore:
Timestamp:
Jan 28, 2010 3:54:12 AM (14 years ago)
Author:
zecke@webkit.org
Message:

[Qt] Speed up KURL to QUrl conversion

https://bugs.webkit.org/show_bug.cgi?id=33873

The WebCore::String::utf8 method will use the generic WebCore::TextCodec
and then call the encode method on it. In QtWebKit this class is implemented
around the QTextCodec class. Instead of going the generic codec way we treat
the WebCore::String as a QString (no copying) and then use the built-in
QString::toUtf8 to do the conversion.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53994 r53995  
     12010-01-18  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [Qt] Speed up KURL to QUrl conversion
     6        https://bugs.webkit.org/show_bug.cgi?id=33873
     7
     8        The WebCore::String::utf8 method will use the generic WebCore::TextCodec
     9        and then call the encode method on it. In QtWebKit this class is implemented
     10        around the QTextCodec class. Instead of going the generic codec way we treat
     11        the WebCore::String as a QString (no copying) and then use the built-in
     12        QString::toUtf8 to do the conversion.
     13
     14        * platform/qt/KURLQt.cpp:
     15        (WebCore::KURL::operator QUrl):
     16
    1172010-01-28  Ben Murdoch  <benm@google.com>
    218
  • trunk/WebCore/platform/qt/KURLQt.cpp

    r53276 r53995  
    8787    // Qt 4.5 or later
    8888    // No need for special encoding
    89     QByteArray ba = m_string.utf8().data();
     89    QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
     90    QByteArray ba = str.toUtf8();
    9091#endif
    9192
Note: See TracChangeset for help on using the changeset viewer.