From ee4c86d1990a9e26277a6948e7027ad8d525ebfa Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 18 Oct 2012 10:55:06 +0200 Subject: Imported WebKit commit 795dcd25a9649fccaf1c9b685f6e2ffedaf7e620 (http://svn.webkit.org/repository/webkit/trunk@131718) New snapshot that includes the return of -fkeep-memory at link time to reduce memory pressure as well as modularized documentation --- .../UIProcess/API/gtk/WebKitURISchemeRequest.cpp | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp') diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp index e69831f29..6f46dbeda 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp @@ -20,25 +20,25 @@ #include "config.h" #include "WebKitURISchemeRequest.h" +#include "WebData.h" #include "WebKitURISchemeRequestPrivate.h" #include "WebKitWebContextPrivate.h" #include "WebKitWebView.h" #include "WebPageProxy.h" +#include "WebSoupRequestManagerProxy.h" #include #include #include #include -using namespace WebKit; - static const unsigned int gReadBufferSize = 8192; G_DEFINE_TYPE(WebKitURISchemeRequest, webkit_uri_scheme_request, G_TYPE_OBJECT) struct _WebKitURISchemeRequestPrivate { WebKitWebContext* webContext; - WKRetainPtr wkRequestManager; - WKRetainPtr wkInitiatingPage; + RefPtr webRequestManager; + RefPtr initiatingPage; uint64_t requestID; CString uri; GOwnPtr soupURI; @@ -71,13 +71,13 @@ static void webkit_uri_scheme_request_class_init(WebKitURISchemeRequestClass* re g_type_class_add_private(requestClass, sizeof(WebKitURISchemeRequestPrivate)); } -WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext* webContext, WKSoupRequestManagerRef wkRequestManager, WKURLRef wkURL, WKPageRef wkInitiatingPage, uint64_t requestID) +WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext* webContext, WebSoupRequestManagerProxy* webRequestManager, WebURL* webURL, WebPageProxy* initiatingPage, uint64_t requestID) { WebKitURISchemeRequest* request = WEBKIT_URI_SCHEME_REQUEST(g_object_new(WEBKIT_TYPE_URI_SCHEME_REQUEST, NULL)); request->priv->webContext = webContext; - request->priv->wkRequestManager = wkRequestManager; - request->priv->uri = toImpl(wkURL)->string().utf8(); - request->priv->wkInitiatingPage = wkInitiatingPage; + request->priv->webRequestManager = webRequestManager; + request->priv->uri = webURL->string().utf8(); + request->priv->initiatingPage = initiatingPage; request->priv->requestID = requestID; return request; } @@ -154,7 +154,7 @@ WebKitWebView* webkit_uri_scheme_request_get_web_view(WebKitURISchemeRequest* re { g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), 0); - return WEBKIT_WEB_VIEW(toImpl(request->priv->wkInitiatingPage.get())->viewWidget()); + return WEBKIT_WEB_VIEW(request->priv->initiatingPage->viewWidget()); } static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsyncResult* result, WebKitURISchemeRequest* schemeRequest) @@ -168,14 +168,13 @@ static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsync } WebKitURISchemeRequestPrivate* priv = request->priv; - WKRetainPtr wkData(AdoptWK, WKDataCreate(bytesRead ? reinterpret_cast(priv->readBuffer) : 0, bytesRead)); + RefPtr webData = WebData::create(reinterpret_cast(priv->readBuffer), bytesRead); if (!priv->bytesRead) { - // First chunk read. In case of empty reply an empty WKDataRef is sent to the WebProcess. - WKRetainPtr wkMimeType = !priv->mimeType.isNull() ? adoptWK(WKStringCreateWithUTF8CString(priv->mimeType.data())) : 0; - WKSoupRequestManagerDidHandleURIRequest(priv->wkRequestManager.get(), wkData.get(), priv->streamLength, wkMimeType.get(), priv->requestID); + // First chunk read. In case of empty reply an empty WebData is sent to the WebProcess. + priv->webRequestManager->didHandleURIRequest(webData.get(), priv->streamLength, String::fromUTF8(priv->mimeType.data()), priv->requestID); } else if (bytesRead || (!bytesRead && !priv->streamLength)) { - // Subsequent chunk read. We only send an empty WKDataRef to the WebProcess when stream length is unknown. - WKSoupRequestManagerDidReceiveURIRequestData(priv->wkRequestManager.get(), wkData.get(), priv->requestID); + // Subsequent chunk read. We only send an empty WebData to the WebProcess when stream length is unknown. + priv->webRequestManager->didReceiveURIRequestData(webData.get(), priv->requestID); } if (!bytesRead) { -- cgit v1.2.1