Changeset 62903 in webkit


Ignore:
Timestamp:
Jul 9, 2010 12:11:19 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-09 Anders Bakken <agbakken@gmail.com>

Reviewed by Simon Hausmann.

[Qt] Remove superfluous function calls
https://bugs.webkit.org/show_bug.cgi?id=40353

QWebFrame::setUrl() calls ensureAbsoluteUrl() twice. It's better to
store a local variable and reuse this one.

QWebFrame::load(QUrl) calls QWebFrame::load(QNetworkRequest) which in
turn will get the QUrl from the request and make sure it's absolute by
calling ensureAbsoluteUrl() on it.

  • Api/qwebframe.cpp: (QWebFrame::setUrl): (QWebFrame::load):
Location:
trunk/WebKit/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r61879 r62903  
    622622void QWebFrame::setUrl(const QUrl &url)
    623623{
    624     d->frame->loader()->writer()->begin(ensureAbsoluteUrl(url));
     624    const QUrl absolute = ensureAbsoluteUrl(url);
     625    d->frame->loader()->writer()->begin(absolute);
    625626    d->frame->loader()->writer()->end();
    626     load(ensureAbsoluteUrl(url));
     627    load(absolute);
    627628}
    628629
     
    715716void QWebFrame::load(const QUrl &url)
    716717{
    717     load(QNetworkRequest(ensureAbsoluteUrl(url)));
     718    // The load() overload ensures that the url is absolute.
     719    load(QNetworkRequest(url));
    718720}
    719721
  • trunk/WebKit/qt/ChangeLog

    r62898 r62903  
     12010-07-09  Anders Bakken  <agbakken@gmail.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] Remove superfluous function calls
     6        https://bugs.webkit.org/show_bug.cgi?id=40353
     7
     8        QWebFrame::setUrl() calls ensureAbsoluteUrl() twice. It's better to
     9        store a local variable and reuse this one.
     10
     11        QWebFrame::load(QUrl) calls QWebFrame::load(QNetworkRequest) which in
     12        turn will get the QUrl from the request and make sure it's absolute by
     13        calling ensureAbsoluteUrl() on it.
     14
     15        * Api/qwebframe.cpp:
     16        (QWebFrame::setUrl):
     17        (QWebFrame::load):
     18
    1192010-07-08  Sam Magnuson  <smagnuson@netflix.com>
    220
Note: See TracChangeset for help on using the changeset viewer.