diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-02-26 19:25:07 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2016-02-26 16:51:19 +0000 |
commit | 4aed18cdbc79105b704a298e88af563f30e2eeb0 (patch) | |
tree | 20bceb6a588b055f8d0f006674988cecc5ceb794 | |
parent | 5f359baacdf92fabcece83f0a2b30f74c7c02a3c (diff) | |
download | qtwebkit-4aed18cdbc79105b704a298e88af563f30e2eeb0.tar.gz |
isLinkVisited: Don't build complete URL unless we use QWebHistoryInterface.
visitedURL() is non-trivial function with memory allocations,
so we should not call it for nothing.
Change-Id: I72e14fac75640cb6b22dd1444b9a061e8432dd7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
-rw-r--r-- | Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp b/Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp index a8487f2c4..7fcf3de45 100644 --- a/Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp @@ -200,14 +200,14 @@ bool PlatformStrategiesQt::isLinkVisited(Page* page, LinkHash hash, const KURL& { ASSERT(hash); - Vector<UChar, 512> url; - visitedURL(baseURL, attributeURL, url); - // If the Qt4.4 interface for the history is used, we will have to fallback // to the old global history. QWebHistoryInterface* iface = QWebHistoryInterface::defaultInterface(); - if (iface) + if (iface) { + Vector<UChar, 512> url; + visitedURL(baseURL, attributeURL, url); return iface->historyContains(QString(reinterpret_cast<QChar*>(url.data()), url.size())); + } return page->group().isLinkVisited(hash); } |