Summary: | [Qt] Even if QNetworkRequest::AlwaysCache is set on a request, a page will be loaded from the network the first time | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tor Arne Vestbø <vestbo> | ||||||||
Component: | New Bugs | Assignee: | QtWebKit Unassigned <webkit-qt-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | jhanssen, kent.hansen, webkit.review.bot | ||||||||
Priority: | P2 | Keywords: | Qt | ||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Other | ||||||||||
OS: | OS X 10.5 | ||||||||||
Attachments: |
|
Description
Tor Arne Vestbø
2010-03-03 04:01:00 PST
Created attachment 75649 [details]
Patch
Comment on attachment 75649 [details]
Patch
lgtm
Comment on attachment 75649 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=75649&action=review > WebKit/qt/Api/qwebframe.cpp:867 > + switch (cacheLoadValue) { > + case QNetworkRequest::AlwaysNetwork: > + request.setCachePolicy(WebCore::ReloadIgnoringCacheData); > + break; > + case QNetworkRequest::PreferCache: > + request.setCachePolicy(WebCore::ReturnCacheDataElseLoad); > + break; > + case QNetworkRequest::AlwaysCache: > + request.setCachePolicy(WebCore::ReturnCacheDataDontLoad); > + break; > + case QNetworkRequest::PreferNetwork: > + request.setCachePolicy(WebCore::UseProtocolCachePolicy); > + break; This would be much better as a helper function to convert the enum. Then you only need one request.setCachePolicy call and this function gets much cleaner. Created attachment 76261 [details]
Patch
Comment on attachment 76261 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=76261&action=review LGTM, two small things: > WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:3075 > + : QNetworkAccessManager(parent), m_lastCacheLoad(QNetworkRequest::PreferNetwork) Style, initializers should be on separate lines. > WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:3083 > + m_lastCacheLoad = static_cast<QNetworkRequest::CacheLoadControl>(cacheLoad.toInt()); You're using toInt() here and toUInt() in QWebFrame::load(). Created attachment 76305 [details]
Patch
(In reply to comment #6) > (From update of attachment 76261 [details]) > > WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:3083 > > + m_lastCacheLoad = static_cast<QNetworkRequest::CacheLoadControl>(cacheLoad.toInt()); > > You're using toInt() here and toUInt() in QWebFrame::load(). Indeed, nice catch. I should have spotted that :) Comment on attachment 76305 [details] Patch Clearing flags on attachment: 76305 Committed r73865: <http://trac.webkit.org/changeset/73865> All reviewed patches have been landed. Closing bug. |