Reviewed by Dan Bernstein.
WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
https://bugs.webkit.org/show_bug.cgi?id=52897
<rdar://problem/
8898294>
* WebCore.exp.in: Add export now needed by WebKit2
2011-02-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dan Bernstein.
WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
https://bugs.webkit.org/show_bug.cgi?id=52897
<rdar://problem/
8898294>
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
2011-02-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dan Bernstein.
WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
https://bugs.webkit.org/show_bug.cgi?id=52897
<rdar://problem/
8898294>
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::willSendRequestForFrame):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77611
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-03 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
+ https://bugs.webkit.org/show_bug.cgi?id=52897
+ <rdar://problem/8898294>
+
+ * WebCore.exp.in: Add export now needed by WebKit2
+
2011-02-03 Victoria Kirst <vrk@google.com>
Reviewed by James Robinson.
__ZNK7WebCore19ResourceRequestBase10httpMethodEv
__ZNK7WebCore19ResourceRequestBase15httpHeaderFieldEPKc
__ZNK7WebCore19ResourceRequestBase3urlEv
+__ZNK7WebCore19ResourceRequestBase6isNullEv
__ZNK7WebCore19ResourceRequestBase7isEmptyEv
__ZNK7WebCore19SelectionController11currentFormEv
__ZNK7WebCore19SelectionController15copyTypingStyleEv
+2011-02-03 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
+ https://bugs.webkit.org/show_bug.cgi?id=52897
+ <rdar://problem/8898294>
+
+ * Shared/API/c/WKSharedAPICast.h:
+ (WebKit::toAPI):
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
+ (WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
+
2011-02-03 Ivan Krstić <ike@apple.com>
Reviewed by Maciej Stachowiak.
#include "WebNumber.h"
#include "WebString.h"
#include "WebURL.h"
+#include "WebURLRequest.h"
+#include "WebURLResponse.h"
#include <WebCore/ContextMenuItem.h>
#include <WebCore/FloatRect.h>
#include <WebCore/FrameLoaderTypes.h>
return ProxyingRefPtr<WebError>(WebError::create(error));
}
+inline ProxyingRefPtr<WebURLRequest> toAPI(const WebCore::ResourceRequest& request)
+{
+ return ProxyingRefPtr<WebURLRequest>(WebURLRequest::create(request));
+}
+
+inline ProxyingRefPtr<WebURLResponse> toAPI(const WebCore::ResourceResponse& response)
+{
+ return ProxyingRefPtr<WebURLResponse>(WebURLResponse::create(response));
+}
+
/* Geometry conversions */
inline WebCore::FloatRect toFloatRect(const WKRect& wkRect)
typedef void (*WKBundlePageDidCancelClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
typedef void (*WKBundlePageWillPerformClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date, const void *clientInfo);
typedef void (*WKBundlePageDidHandleOnloadEventsForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
-typedef bool (*WKBundlePageShouldLoadResourceForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKStringRef url, const void *clientInfo);
+typedef WKURLRequestRef (*WKBundlePageWillSendRequestForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKURLRequestRef request, WKURLResponseRef redirectResponse, const void *clientInfo);
+
struct WKBundlePageLoaderClient {
WKBundlePageDidCancelClientRedirectForFrameCallback didCancelClientRedirectForFrame;
WKBundlePageWillPerformClientRedirectForFrameCallback willPerformClientRedirectForFrame;
WKBundlePageDidHandleOnloadEventsForFrameCallback didHandleOnloadEventsForFrame;
- WKBundlePageShouldLoadResourceForFrameCallback shouldLoadResourceForFrame;
+ WKBundlePageWillSendRequestForFrameCallback willSendRequestForFrame;
};
typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient;
userData = adoptRef(toImpl(userDataToPass));
}
-bool InjectedBundlePageLoaderClient::shouldLoadResourceForFrame(WebPage* page, WebFrame* frame, const String& resourceURL)
+void InjectedBundlePageLoaderClient::willSendRequestForFrame(WebPage* page, WebFrame* frame, uint64_t identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
- if (!m_client.shouldLoadResourceForFrame)
- return true;
+ if (!m_client.willSendRequestForFrame)
+ return;
- return m_client.shouldLoadResourceForFrame(toAPI(page), toAPI(frame), toAPI(resourceURL.impl()), m_client.clientInfo);
+ request = toImpl(m_client.willSendRequestForFrame(toAPI(page), toAPI(frame), identifier, toAPI(request), toAPI(redirectResponse), m_client.clientInfo))->resourceRequest();
}
void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld* world)
namespace WebCore {
class DOMWrapperWorld;
class ResourceError;
+class ResourceRequest;
+class ResourceResponse;
}
namespace WebKit {
void didDisplayInsecureContentForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
void didRunInsecureContentForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);
- bool shouldLoadResourceForFrame(WebPage*, WebFrame*, const String&);
+ void willSendRequestForFrame(WebPage*, WebFrame*, uint64_t identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
void didClearWindowObjectForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld*);
void didCancelClientRedirectForFrame(WebPage*, WebFrame*);
if (!webPage)
return;
- if (!webPage->injectedBundleLoaderClient().shouldLoadResourceForFrame(webPage, m_frame, request.url().string())) {
- request = ResourceRequest();
+ webPage->injectedBundleLoaderClient().willSendRequestForFrame(webPage, m_frame, identifier, request, redirectResponse);
+
+ if (request.isNull()) {
// FIXME: We should probably send a message saying we cancelled the request for the resource.
return;
}
+2011-02-03 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
+ https://bugs.webkit.org/show_bug.cgi?id=52897
+ <rdar://problem/8898294>
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::willSendRequestForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
2011-02-03 Ivan Krstić <ike@apple.com>
Unreviewed.
didCancelClientRedirectForFrame,
willPerformClientRedirectForFrame,
didHandleOnloadEventsForFrame,
- shouldLoadResourceForFrame
+ willSendRequestForFrame
};
WKBundlePageSetLoaderClient(m_page, &loaderClient);
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didRunInsecureContentForFrame(frame);
}
-bool InjectedBundlePage::shouldLoadResourceForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKStringRef, const void* clientInfo)
+WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef redirectResponse, const void* clientInfo)
{
- return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldLoadResourceForFrame(frame);
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willSendRequestForFrame(page, frame, identifier, request, redirectResponse);
}
-
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
{
if (!InjectedBundle::shared().isTestRunning())
{
}
-bool InjectedBundlePage::shouldLoadResourceForFrame(WKBundleFrameRef frame)
+WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKURLRequestRef request, WKURLResponseRef)
{
- return true;
+ return request;
}
// UI Client Callbacks
static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
- static bool shouldLoadResourceForFrame(WKBundlePageRef, WKBundleFrameRef, WKStringRef, const void*);
+ static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef, WKURLResponseRef, const void*);
void didStartProvisionalLoadForFrame(WKBundleFrameRef);
void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef);
void didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef, WKErrorRef);
void didHandleOnloadEventsForFrame(WKBundleFrameRef);
void didDisplayInsecureContentForFrame(WKBundleFrameRef);
void didRunInsecureContentForFrame(WKBundleFrameRef);
- bool shouldLoadResourceForFrame(WKBundleFrameRef);
+ WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef, WKURLResponseRef);
// UI Client
static void willAddMessageToConsole(WKBundlePageRef, WKStringRef message, uint32_t lineNumber, const void* clientInfo);