Summary: | [Qt] ResourceHandle::willLoadFromCache needs to be implmeneted QtWebKit. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yongjun Zhang <yongjun.zhang> | ||||||
Component: | WebKit Qt | Assignee: | Yongjun Zhang <yongjun.zhang> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | hausmann, laszlo.gombos, zecke | ||||||
Priority: | P2 | Keywords: | Qt | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Attachments: |
|
Description
Yongjun Zhang
2009-06-30 11:26:58 PDT
Created attachment 32079 [details]
Implement willLoadFromCache for QtWebKit.
Implement ResouceHandler::willLoadFromCache in QtWebKit, add Frame* argument to generic willLoadFromCache because it is needed to figure out the right QNetworkAccessManager from QWebPage.
Comment on attachment 32079 [details]
Implement willLoadFromCache for QtWebKit.
Why does Qt need the frame and no other port does?
Isn't there a global "network manager"?
+ QNetworkAccessManager* manager = QWebFramePrivate::kit(frame)->page()->networkAccessManager();
(In reply to comment #2) > (From update of attachment 32079 [details] [review]) > Why does Qt need the frame and no other port does? > > Isn't there a global "network manager"? > + QNetworkAccessManager* manager = > QWebFramePrivate::kit(frame)->page()->networkAccessManager(); > I think the Qt port is the only one that allows that kind of sandboxing, where there is a per page (or page group) specific network manager and similar things. From an application developer's point of view that's very convenient. Comment on attachment 32079 [details] Implement willLoadFromCache for QtWebKit. > -bool ResourceHandle::willLoadFromCache(ResourceRequest& request) > +bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame) this will break the mac build... remove the unused parameter > +#if QT_VERSION >= 0x040400 > + QNetworkAccessManager* manager = QWebFramePrivate::kit(frame)->page()->networkAccessManager(); > + QAbstractNetworkCache* cache = manager->cache(); this will not work on Qt4.4... the cache got added in Qt 4.5... please revise the patch, it looks good otherwise! (In reply to comment #2) > (From update of attachment 32079 [details]) > Why does Qt need the frame and no other port does? > > Isn't there a global "network manager"? > + QNetworkAccessManager* manager = > QWebFramePrivate::kit(frame)->page()->networkAccessManager(); Qt has a network manager instance per QWebPage. E.g. different parts of the app (think of the help system) have different policies for networking access... anyway this was just a quick example. Prior changes due this included the static/synchronous XMLHttpRequest implementation and cookies. Back then we have added the Frame*/Document* to the signature with Apple's review, I think it is the same case here. Created attachment 33100 [details]
modify the patch to include Zecke's review comments.
Incorporate Zeke's comments:
1. leave Frame* argument empty to be able to build in mac.
2. enable the feature in QT_VERSION 4.5, where disk cache was first introduced.
Comment on attachment 33100 [details]
modify the patch to include Zecke's review comments.
r=me. There's a typo in the ChangeLog and the "No new tests" line shouldn't be there, but I'll remove that when landing.
|