Changeset 59669 in webkit
- Timestamp:
- May 18, 2010 7:07:00 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r59668 r59669 1 2010-05-08 Robert Hogan <robert@roberthogan.net> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Fix http/tests/xmlhttprequest/cross-origin-no-authorization.html 6 and http/tests/xmlhttprequest/cross-origin-authorization.html 7 8 QHttpNetworkRequest adds Authorization and Cookie headers to XHRs 9 without knowing if this is valid behaviour or not. In order to allow 10 Qt to decide whether Cookie/Authorization headers should be added 11 to an XHR QtWebKit needs to use an attribute added to QNetworkRequest. 12 These new attributes are: QNetworkRequest::CookieLoadControlAttribute, 13 QNetworkRequest::CookieSaveControlAttribute,and 14 QNetworkRequest::AuthenticationReuseControlAttribute. 15 16 QtWebKit will set QNetworkRequest::AuthenticationReuseControlAttribute to false 17 unless withCredentials is set to true in the XHR. 18 19 QtWebkit will set CookieLoad/SaveControlAttribute to false unless withCredentials 20 is set to true in the XHR. 21 22 Qt will pass the values onto QHttpNetworkRequest and this will permit 23 the Qt network access processing to decide whether or not to add either 24 or both of the Cookie/Authorisation headers, and whether to save cookies 25 returned from such requests. By default the attribute 26 will always be true so unless QtWebKit sets it to false normal 27 header processing is unaffected. 28 29 The Qt part of these changes was merged at: http://gitorious.org/qt/qt/merge_requests/592 30 31 https://bugs.webkit.org/show_bug.cgi?id=32967 32 33 * platform/network/qt/ResourceRequestQt.cpp: 34 (WebCore::ResourceRequest::toNetworkRequest): 35 1 36 2010-05-18 Zoltan Herczeg <zherczeg@webkit.org> 2 37 -
trunk/WebCore/platform/network/qt/ResourceRequestQt.cpp
r59076 r59669 81 81 } 82 82 83 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) 84 if (!allowCookies()) { 85 request.setAttribute(QNetworkRequest::CookieLoadControlAttribute, QNetworkRequest::Manual); 86 request.setAttribute(QNetworkRequest::CookieSaveControlAttribute, QNetworkRequest::Manual); 87 request.setAttribute(QNetworkRequest::AuthenticationReuseAttribute, QNetworkRequest::Manual); 88 } 89 #endif 90 83 91 return request; 84 92 } -
trunk/WebKitTools/ChangeLog
r59666 r59669 1 2010-05-08 Robert Hogan <robert@roberthogan.net> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Fix http/tests/xmlhttprequest/cross-origin-no-authorization.html 6 and http/tests/xmlhttprequest/cross-origin-authorization.html 7 8 QHttpNetworkRequest adds Authorization and Cookie headers to XHRs 9 without knowing if this is valid behaviour or not. In order to allow 10 Qt to decide whether Cookie/Authorization headers should be added 11 to an XHR QtWebKit needs to use an attribute added to QNetworkRequest. 12 These new attributes are: QNetworkRequest::CookieLoadControlAttribute, 13 QNetworkRequest::CookieSaveControlAttribute,and 14 QNetworkRequest::AuthenticationReuseControlAttribute. 15 16 In order to properly support the tests, Qt's DRT needs to use one 17 NetworkAccessManager for all pages. This allows it to use cached 18 credentials where appropriate. 19 20 The tests now pass when run individually but there seems to be a problem with 21 leaking the results of requests across tests when run with the others in 22 http/tests. This will be addressed in a separate patch. 23 24 https://bugs.webkit.org/show_bug.cgi?id=32967 25 26 27 * DumpRenderTree/qt/DumpRenderTreeQt.cpp: 28 (WebCore::WebPage::WebPage): 29 (WebCore::DumpRenderTree::DumpRenderTree): 30 * DumpRenderTree/qt/DumpRenderTreeQt.h: 31 32 1 33 2010-05-18 Fumitoshi Ukai <ukai@chromium.org> 2 34 -
trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
r59623 r59669 157 157 this, SLOT(setViewGeometry(const QRect & ))); 158 158 159 setNetworkAccessManager( new NetworkAccessManager(this));159 setNetworkAccessManager(m_drt->networkAccessManager()); 160 160 setPluginFactory(new TestPlugin(this)); 161 161 } … … 347 347 QWebSettings::enablePersistentStorage(m_persistentStoragePath); 348 348 349 m_networkAccessManager = new NetworkAccessManager(this); 349 350 // create our primary testing page/view. 350 351 m_mainView = new QWebView(0); -
trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
r59623 r59669 62 62 63 63 class WebPage; 64 class NetworkAccessManager; 64 65 65 66 class DumpRenderTree : public QObject { … … 88 89 TextInputController *textInputController() const { return m_textInputController; } 89 90 QString persistentStoragePath() const { return m_persistentStoragePath; } 91 NetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; } 90 92 91 93 QWebPage *createWindow(); … … 95 97 96 98 WebPage *webPage() const { return m_page; } 97 98 99 99 100 #if defined(Q_WS_X11) … … 137 138 TextInputController *m_textInputController; 138 139 GCController* m_gcController; 140 NetworkAccessManager* m_networkAccessManager; 139 141 140 142 QFile *m_stdin;
Note: See TracChangeset
for help on using the changeset viewer.