Commit 8e0bc88a authored by sergio@webkit.org's avatar sergio@webkit.org
Browse files

2011-02-16 Sergio Villar Senin <svillar@igalia.com>

        Reviewed by Martin Robinson.

        [Gtk] Add support for layoutTestController.setWillSendRequestClearHeader
        https://bugs.webkit.org/show_bug.cgi?id=54537

        Unskipped http/tests/security/no-referrer.html.

        * platform/gtk/Skipped:
2011-02-16  Sergio Villar Senin  <svillar@igalia.com>

        Reviewed by Martin Robinson.

        [Gtk] Add support for layoutTestController.setWillSendRequestClearHeader
        https://bugs.webkit.org/show_bug.cgi?id=54537

        Headers removed from the SoupMessage should be also removed from
        the ResourceRequest when updating the latter from the former.

        * platform/network/soup/ResourceRequestSoup.cpp:
        (WebCore::ResourceRequest::updateFromSoupMessage):
2011-02-16  Sergio Villar Senin  <svillar@igalia.com>

        Reviewed by Martin Robinson.

        [Gtk] Add support for layoutTestController.setWillSendRequestClearHeader
        https://bugs.webkit.org/show_bug.cgi?id=54537

        Added handler for resource-request-starting emitted in
        FrameLoader's willSendRequest(). The current implementation
        removes the headers set in setWillSendRequestClearHeader.

        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        (willSendRequestCallback):
        (createWebView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e681cf4c
2011-02-16 Sergio Villar Senin <svillar@igalia.com>
Reviewed by Martin Robinson.
[Gtk] Add support for layoutTestController.setWillSendRequestClearHeader
https://bugs.webkit.org/show_bug.cgi?id=54537
Unskipped http/tests/security/no-referrer.html.
* platform/gtk/Skipped:
2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
 
Reviewed by Yury Semikhatsky.
......@@ -1556,9 +1556,6 @@ http/tests/xmlhttprequest/simple-cross-origin-progress-events.html
# Fails on and off (more often fails) on the release bot
media/event-attributes.html
# GTK+ does not have layoutTestController.setWillSendRequestClearHeader.
http/tests/security/no-referrer.html
# GTK+ does not have layoutTestController.setWillSendRequestReturnsNull.
fast/loader/onload-willSendRequest-null-for-script.html
fast/loader/willSendRequest-null-for-preload.html
......
2011-02-16 Sergio Villar Senin <svillar@igalia.com>
Reviewed by Martin Robinson.
[Gtk] Add support for layoutTestController.setWillSendRequestClearHeader
https://bugs.webkit.org/show_bug.cgi?id=54537
Headers removed from the SoupMessage should be also removed from
the ResourceRequest when updating the latter from the former.
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateFromSoupMessage):
2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
 
Reviewed by Yury Semikhatsky.
......@@ -92,10 +92,21 @@ void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
SoupMessageHeadersIter headersIter;
const char* headerName;
const char* headerValue;
HashMap<String, bool> headersHash;
soup_message_headers_iter_init(&headersIter, soupMessage->request_headers);
while (soup_message_headers_iter_next(&headersIter, &headerName, &headerValue))
while (soup_message_headers_iter_next(&headersIter, &headerName, &headerValue)) {
m_httpHeaderFields.set(String::fromUTF8(headerName), String::fromUTF8(headerValue));
headersHash.add(headerName, true);
}
if (!m_httpHeaderFields.isEmpty()) {
HTTPHeaderMap::iterator end = m_httpHeaderFields.end();
for (HTTPHeaderMap::iterator it = m_httpHeaderFields.begin(); it != end; ++it) {
if (!headersHash.contains(it->first.string()))
m_httpHeaderFields.remove(it->first.string());
}
}
if (soupMessage->request_body->data)
m_httpBody = FormData::create(soupMessage->request_body->data, soupMessage->request_body->length);
......
2011-02-16 Sergio Villar Senin <svillar@igalia.com>
Reviewed by Martin Robinson.
[Gtk] Add support for layoutTestController.setWillSendRequestClearHeader
https://bugs.webkit.org/show_bug.cgi?id=54537
Added handler for resource-request-starting emitted in
FrameLoader's willSendRequest(). The current implementation
removes the headers set in setWillSendRequestClearHeader.
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(willSendRequestCallback):
(createWebView):
2011-02-16 Csaba Osztrogonác <ossy@webkit.org>
 
Reviewed by Andreas Kling.
......@@ -1012,6 +1012,17 @@ static void frameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* webFram
g_signal_connect(webFrame, "notify::load-status", G_CALLBACK(webFrameLoadStatusNotified), NULL);
}
static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame*, WebKitWebResource*, WebKitNetworkRequest* request, WebKitNetworkResponse*)
{
SoupMessage* soupMessage = webkit_network_request_get_message(request);
if (soupMessage) {
const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header)
soup_message_headers_remove(soupMessage->request_headers, header->c_str());
}
}
static WebKitWebView* createWebView()
{
WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
......@@ -1040,6 +1051,7 @@ static WebKitWebView* createWebView()
"signal::drag-end", dragEndCallback, 0,
"signal::drag-failed", dragFailedCallback, 0,
"signal::frame-created", frameCreatedCallback, 0,
"signal::resource-request-starting", willSendRequestCallback, 0,
NULL);
connectEditingCallbacks(view);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment