summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-23 10:25:11 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-23 10:25:11 +0200
commit5ea819f80c6840c492386bfafbffb059c7e2091f (patch)
tree42ad0b1d82eff090d14278a088ea0f4840a0f938 /Source/WebKit2/UIProcess
parent43a42f108af6bcbd91f2672731c3047c26213af1 (diff)
downloadqtwebkit-5ea819f80c6840c492386bfafbffb059c7e2091f.tar.gz
Imported WebKit commit 20434eb8eb95065803473139d8794e98a7672f75 (http://svn.webkit.org/repository/webkit/trunk@132191)
New snapshot that should fix build with latest qtbase and the QPlastiqueStyle removal
Diffstat (limited to 'Source/WebKit2/UIProcess')
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.cpp89
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client_private.h34
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_private.h12
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client.cpp103
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client_private.h34
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKView.mm43
-rw-r--r--Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp4
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp28
-rw-r--r--Source/WebKit2/UIProcess/WebContext.h2
-rw-r--r--Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp5
-rw-r--r--Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp5
-rw-r--r--Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebIconDatabase.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp5
-rw-r--r--Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.h4
-rw-r--r--Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/WebVibrationProxy.cpp3
-rw-r--r--Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp (renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp)71
-rw-r--r--Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h67
-rw-r--r--Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp149
-rw-r--r--Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h62
-rw-r--r--Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp3
28 files changed, 417 insertions, 332 deletions
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp
index 76de21a4f..cecad7652 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.cpp
@@ -51,7 +51,7 @@ Ewk_Form_Submission_Request::~Ewk_Form_Submission_Request()
String Ewk_Form_Submission_Request::fieldValue(const String& fieldName) const
{
ASSERT(fieldName);
- WKRetainPtr<WKStringRef> wkFieldName = toCopiedAPI(fieldName);
+ WKRetainPtr<WKStringRef> wkFieldName = adoptWK(toCopiedAPI(fieldName));
WKStringRef wkValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(m_wkValues.get(), wkFieldName.get()));
return wkValue ? toImpl(wkValue)->string() : String();
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
index d8608aa48..fc955ec82 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
@@ -25,7 +25,9 @@
#include "NativeWebMouseEvent.h"
#include "NativeWebWheelEvent.h"
#include "PageClientImpl.h"
+#include "PageLoadClientEfl.h"
#include "RefPtrEfl.h"
+#include "ResourceLoadClientEfl.h"
#include "WKAPICast.h"
#include "WKColorPickerResultListener.h"
#include "WKEinaSharedString.h"
@@ -51,10 +53,8 @@
#include "ewk_settings_private.h"
#include "ewk_view_find_client_private.h"
#include "ewk_view_form_client_private.h"
-#include "ewk_view_loader_client_private.h"
#include "ewk_view_policy_client_private.h"
#include "ewk_view_private.h"
-#include "ewk_view_resource_load_client_private.h"
#include "ewk_view_ui_client_private.h"
#include <Ecore_Evas.h>
#include <Edje.h>
@@ -86,7 +86,6 @@ static const char EWK_VIEW_TYPE_STR[] = "EWK2_View";
static const int defaultCursorSize = 16;
-typedef HashMap< uint64_t, RefPtr<Ewk_Resource> > LoadingResourcesMap;
static void _ewk_view_on_favicon_changed(const char* pageURL, void* eventInfo);
typedef HashMap<const WebPageProxy*, const Evas_Object*> PageViewMap;
@@ -119,6 +118,8 @@ struct Ewk_View_Private_Data {
OwnPtr<PageViewportControllerClientEfl> pageViewportControllerClient;
#endif
RefPtr<WebPageProxy> pageProxy;
+ OwnPtr<PageLoadClientEfl> pageLoadClient;
+ OwnPtr<ResourceLoadClientEfl> resourceLoadClient;
WKEinaSharedString url;
WKEinaSharedString title;
@@ -127,7 +128,6 @@ struct Ewk_View_Private_Data {
WKEinaSharedString cursorGroup;
WKEinaSharedString faviconURL;
RefPtr<Evas_Object> cursorObject;
- LoadingResourcesMap loadingResourcesMap;
OwnPtr<Ewk_Back_Forward_List> backForwardList;
OwnPtr<Ewk_Settings> settings;
bool areMouseEventsEnabled;
@@ -828,17 +828,18 @@ static void _ewk_view_initialize(Evas_Object* ewkView, Ewk_Context* context, WKP
priv->pageViewportControllerClient = PageViewportControllerClientEfl::create(ewkView);
#endif
+ // Initialize page clients.
WKPageRef wkPage = toAPI(priv->pageProxy.get());
ewk_view_find_client_attach(wkPage, ewkView);
ewk_view_form_client_attach(wkPage, ewkView);
- ewk_view_loader_client_attach(wkPage, ewkView);
ewk_view_policy_client_attach(wkPage, ewkView);
- ewk_view_resource_load_client_attach(wkPage, ewkView);
ewk_view_ui_client_attach(wkPage, ewkView);
#if ENABLE(FULLSCREEN_API)
priv->pageProxy->fullScreenManager()->setWebView(ewkView);
ewk_settings_fullscreen_enabled_set(priv->settings.get(), true);
#endif
+ priv->pageLoadClient = PageLoadClientEfl::create(ewkView);
+ priv->resourceLoadClient = ResourceLoadClientEfl::create(ewkView);
/* Listen for favicon changes */
Ewk_Favicon_Database* iconDatabase = ewk_context_favicon_database_get(priv->context);
@@ -1015,20 +1016,26 @@ Ewk_Settings* ewk_view_settings_get(const Evas_Object* ewkView)
/**
* @internal
+ * Retrieves the internal WKPage for this view.
+ */
+WKPageRef ewk_view_wkpage_get(const Evas_Object* ewkView)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
+
+ return toAPI(priv->pageProxy.get());
+}
+
+/**
+ * @internal
* Load was initiated for a resource in the view.
*
* Emits signal: "resource,request,new" with pointer to resource request.
*/
-void ewk_view_resource_load_initiated(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Resource* resource, Ewk_Url_Request* request)
+void ewk_view_resource_load_initiated(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Url_Request* request)
{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
Ewk_Resource_Request resourceRequest = {resource, request, 0};
- // Keep the resource internally to reuse it later.
- priv->loadingResourcesMap.add(resourceIdentifier, resource);
-
evas_object_smart_callback_call(ewkView, "resource,request,new", &resourceRequest);
}
@@ -1038,16 +1045,9 @@ void ewk_view_resource_load_initiated(Evas_Object* ewkView, uint64_t resourceIde
*
* Emits signal: "resource,request,response" with pointer to resource response.
*/
-void ewk_view_resource_load_response(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Response* response)
+void ewk_view_resource_load_response(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Url_Response* response)
{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- if (!priv->loadingResourcesMap.contains(resourceIdentifier))
- return;
-
- RefPtr<Ewk_Resource> resource = priv->loadingResourcesMap.get(resourceIdentifier);
- Ewk_Resource_Load_Response resourceLoadResponse = {resource.get(), response};
+ Ewk_Resource_Load_Response resourceLoadResponse = {resource, response};
evas_object_smart_callback_call(ewkView, "resource,request,response", &resourceLoadResponse);
}
@@ -1057,16 +1057,9 @@ void ewk_view_resource_load_response(Evas_Object* ewkView, uint64_t resourceIden
*
* Emits signal: "resource,request,finished" with pointer to the resource load error.
*/
-void ewk_view_resource_load_failed(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Error* error)
+void ewk_view_resource_load_failed(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Error* error)
{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- if (!priv->loadingResourcesMap.contains(resourceIdentifier))
- return;
-
- RefPtr<Ewk_Resource> resource = priv->loadingResourcesMap.get(resourceIdentifier);
- Ewk_Resource_Load_Error resourceLoadError = {resource.get(), error};
+ Ewk_Resource_Load_Error resourceLoadError = {resource, error};
evas_object_smart_callback_call(ewkView, "resource,request,failed", &resourceLoadError);
}
@@ -1076,16 +1069,9 @@ void ewk_view_resource_load_failed(Evas_Object* ewkView, uint64_t resourceIdenti
*
* Emits signal: "resource,request,finished" with pointer to the resource.
*/
-void ewk_view_resource_load_finished(Evas_Object* ewkView, uint64_t resourceIdentifier)
+void ewk_view_resource_load_finished(Evas_Object* ewkView, Ewk_Resource* resource)
{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- if (!priv->loadingResourcesMap.contains(resourceIdentifier))
- return;
-
- RefPtr<Ewk_Resource> resource = priv->loadingResourcesMap.take(resourceIdentifier);
- evas_object_smart_callback_call(ewkView, "resource,request,finished", resource.get());
+ evas_object_smart_callback_call(ewkView, "resource,request,finished", resource);
}
/**
@@ -1094,17 +1080,9 @@ void ewk_view_resource_load_finished(Evas_Object* ewkView, uint64_t resourceIden
*
* Emits signal: "resource,request,sent" with pointer to resource request and possible redirect response.
*/
-void ewk_view_resource_request_sent(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Request* request, Ewk_Url_Response* redirectResponse)
+void ewk_view_resource_request_sent(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Url_Request* request, Ewk_Url_Response* redirectResponse)
{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- if (!priv->loadingResourcesMap.contains(resourceIdentifier))
- return;
-
- RefPtr<Ewk_Resource> resource = priv->loadingResourcesMap.get(resourceIdentifier);
- Ewk_Resource_Request resourceRequest = {resource.get(), request, redirectResponse};
-
+ Ewk_Resource_Request resourceRequest = {resource, request, redirectResponse};
evas_object_smart_callback_call(ewkView, "resource,request,sent", &resourceRequest);
}
@@ -1538,13 +1516,6 @@ void ewk_view_load_provisional_redirect(Evas_Object* ewkView)
*/
void ewk_view_load_provisional_started(Evas_Object* ewkView)
{
- EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
- EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
-
- // The main frame started provisional load, we should clear
- // the loadingResources HashMap to start clean.
- priv->loadingResourcesMap.clear();
-
ewk_view_url_update(ewkView);
evas_object_smart_callback_call(ewkView, "load,provisional,started", 0);
}
@@ -1942,8 +1913,8 @@ Eina_Bool ewk_view_color_picker_color_set(Evas_Object* ewkView, int r, int g, in
EINA_SAFETY_ON_NULL_RETURN_VAL(priv->colorPickerResultListener, false);
WebCore::Color color = WebCore::Color(r, g, b, a);
- const WKStringRef colorString = WKStringCreateWithUTF8CString(color.serialized().utf8().data());
- WKColorPickerResultListenerSetColor(priv->colorPickerResultListener.get(), colorString);
+ WKRetainPtr<WKStringRef> colorString(AdoptWK, WKStringCreateWithUTF8CString(color.serialized().utf8().data()));
+ WKColorPickerResultListenerSetColor(priv->colorPickerResultListener.get(), colorString.get());
priv->colorPickerResultListener.clear();
return true;
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client_private.h
deleted file mode 100644
index 615c019fc..000000000
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client_private.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ewk_view_loader_client_private_h
-#define ewk_view_loader_client_private_h
-
-#include <Evas.h>
-#include <WebKit2/WKBase.h>
-
-void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView);
-
-#endif // ewk_view_loader_client_private_h
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
index 61c7bd41a..2066f9eff 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
@@ -77,17 +77,19 @@ void ewk_view_page_close(Evas_Object* ewkView);
WKPageRef ewk_view_page_create(Evas_Object* ewkView);
void ewk_view_title_changed(Evas_Object* ewkView, const char* title);
void ewk_view_tooltip_text_set(Evas_Object* ewkView, const char* text);
-void ewk_view_resource_load_failed(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Error* error);
-void ewk_view_resource_load_finished(Evas_Object* ewkView, uint64_t resourceIdentifier);
-void ewk_view_resource_load_initiated(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Resource* resource, Ewk_Url_Request* request);
-void ewk_view_resource_load_response(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Response* response);
-void ewk_view_resource_request_sent(Evas_Object* ewkView, uint64_t resourceIdentifier, Ewk_Url_Request* request, Ewk_Url_Response* redirectResponse);
+void ewk_view_resource_load_failed(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Error* error);
+void ewk_view_resource_load_finished(Evas_Object* ewkView, Ewk_Resource* resource);
+void ewk_view_resource_load_initiated(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Url_Request* request);
+void ewk_view_resource_load_response(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Url_Response* response);
+void ewk_view_resource_request_sent(Evas_Object* ewkView, Ewk_Resource* resource, Ewk_Url_Request* request, Ewk_Url_Response* redirectResponse);
void ewk_view_text_found(Evas_Object* ewkView, unsigned int matchCount);
void ewk_view_url_update(Evas_Object* ewkView);
void ewk_view_contents_size_changed(const Evas_Object* ewkView, const WebCore::IntSize&);
void ewk_view_back_forward_list_changed(Evas_Object* ewkView);
void ewk_view_update_icon(Evas_Object* ewkView);
+WKPageRef ewk_view_wkpage_get(const Evas_Object* ewkView);
+
Evas_Object* ewk_view_base_add(Evas* canvas, WKContextRef, WKPageGroupRef);
#if ENABLE(WEB_INTENTS)
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client.cpp
deleted file mode 100644
index ce62539d3..000000000
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "WKAPICast.h"
-#include "WKFrame.h"
-#include "WKPage.h"
-#include "WKRetainPtr.h"
-#include "WKURL.h"
-#include "WKURLRequest.h"
-#include "WKURLResponse.h"
-#include "ewk_error_private.h"
-#include "ewk_resource.h"
-#include "ewk_resource_private.h"
-#include "ewk_url_request.h"
-#include "ewk_url_request_private.h"
-#include "ewk_url_response.h"
-#include "ewk_url_response_private.h"
-#include "ewk_view_private.h"
-#include "ewk_view_resource_load_client_private.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/text/CString.h>
-
-using namespace WebCore;
-using namespace WebKit;
-
-static inline Evas_Object* toEwkView(const void* clientInfo)
-{
- return static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
-}
-
-static void didInitiateLoadForResource(WKPageRef, WKFrameRef wkFrame, uint64_t resourceIdentifier, WKURLRequestRef wkRequest, bool pageIsProvisionallyLoading, const void* clientInfo)
-{
- bool isMainResource = (WKFrameIsMainFrame(wkFrame) && pageIsProvisionallyLoading);
- WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKURLRequestCopyURL(wkRequest));
-
- RefPtr<Ewk_Resource> resource = Ewk_Resource::create(wkUrl.get(), isMainResource);
- RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(wkRequest);
- ewk_view_resource_load_initiated(toEwkView(clientInfo), resourceIdentifier, resource.get(), request.get());
-}
-
-static void didSendRequestForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef wkRequest, WKURLResponseRef wkRedirectResponse, const void* clientInfo)
-{
- RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(wkRequest);
- RefPtr<Ewk_Url_Response> redirectResponse = Ewk_Url_Response::create(wkRedirectResponse);
- ewk_view_resource_request_sent(toEwkView(clientInfo), resourceIdentifier, request.get(), redirectResponse.get());
-}
-
-static void didReceiveResponseForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLResponseRef wkResponse, const void* clientInfo)
-{
- RefPtr<Ewk_Url_Response> response = Ewk_Url_Response::create(wkResponse);
- ewk_view_resource_load_response(toEwkView(clientInfo), resourceIdentifier, response.get());
-}
-
-static void didFinishLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, const void* clientInfo)
-{
- ewk_view_resource_load_finished(toEwkView(clientInfo), resourceIdentifier);
-}
-
-static void didFailLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKErrorRef wkError, const void* clientInfo)
-{
- OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(wkError);
- ewk_view_resource_load_failed(toEwkView(clientInfo), resourceIdentifier, ewkError.get());
- ewk_view_resource_load_finished(toEwkView(clientInfo), resourceIdentifier);
-}
-
-void ewk_view_resource_load_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
-{
- WKPageResourceLoadClient wkResourceLoadClient;
- memset(&wkResourceLoadClient, 0, sizeof(WKPageResourceLoadClient));
- wkResourceLoadClient.version = kWKPageResourceLoadClientCurrentVersion;
- wkResourceLoadClient.clientInfo = ewkView;
- wkResourceLoadClient.didInitiateLoadForResource = didInitiateLoadForResource;
- wkResourceLoadClient.didSendRequestForResource = didSendRequestForResource;
- wkResourceLoadClient.didReceiveResponseForResource = didReceiveResponseForResource;
- wkResourceLoadClient.didFinishLoadForResource = didFinishLoadForResource;
- wkResourceLoadClient.didFailLoadForResource = didFailLoadForResource;
-
- WKPageSetPageResourceLoadClient(pageRef, &wkResourceLoadClient);
-}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client_private.h
deleted file mode 100644
index 1f404b920..000000000
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_resource_load_client_private.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ewk_view_resource_load_client_private_h
-#define ewk_view_resource_load_client_private_h
-
-#include <Evas.h>
-#include <WebKit2/WKBase.h>
-
-void ewk_view_resource_load_client_attach(WKPageRef pageRef, Evas_Object* ewkView);
-
-#endif // ewk_view_resource_load_client_private_h
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index cd2de8d25..ac037fb30 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -26,11 +26,6 @@
#import "config.h"
#import "WKView.h"
-#if USE(DICTATION_ALTERNATIVES)
-#import <AppKit/NSTextAlternatives.h>
-#import <AppKit/NSAttributedString.h>
-#endif
-
#import "AttributedString.h"
#import "ColorSpaceData.h"
#import "DataReference.h"
@@ -90,6 +85,10 @@
#import <wtf/RefPtr.h>
#import <wtf/RetainPtr.h>
+#if USE(DICTATION_ALTERNATIVES)
+#import <AppKit/NSTextAlternatives.h>
+#endif
+
@interface NSApplication (WKNSApplicationDetails)
- (void)speakString:(NSString *)string;
- (void)_setCurrentEvent:(NSEvent *)event;
@@ -139,12 +138,6 @@ struct WKViewInterpretKeyEventsParameters {
- (void)_wk_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState;
@end
-@interface WKToolTipDelegate : NSObject {
- RefPtr<WebPageProxy> _page;
-}
-- (id)initWithPage:(WebPageProxy *)page;
-@end
-
@interface WKViewData : NSObject {
@public
OwnPtr<PageClientImpl> _pageClient;
@@ -217,7 +210,6 @@ struct WKViewInterpretKeyEventsParameters {
String _promisedFilename;
String _promisedURL;
- RetainPtr<WKToolTipDelegate> _toolTipDelegate;
RetainPtr<NSMutableArray> _observers;
}
@@ -2520,6 +2512,11 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
[_data->_trackingRectOwner mouseEntered:fakeEvent];
}
+- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data
+{
+ return nsStringFromWebCoreString(_data->_page->toolTip());
+}
+
- (void)_wk_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip
{
if (oldToolTip)
@@ -2529,9 +2526,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
// See radar 3500217 for why we remove all tooltips rather than just the single one we created.
[self removeAllToolTips];
NSRect wideOpenRect = NSMakeRect(-100000, -100000, 200000, 200000);
- if (!_data->_toolTipDelegate)
- _data->_toolTipDelegate = adoptNS([[WKToolTipDelegate alloc] initWithPage:_data->_page.get()]);
- _data->_lastToolTipTag = [self addToolTipRect:wideOpenRect owner:_data->_toolTipDelegate.get() userData:NULL];
+ _data->_lastToolTipTag = [self addToolTipRect:wideOpenRect owner:self userData:NULL];
[self _wk_sendToolTipMouseEntered];
}
}
@@ -3198,21 +3193,3 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
}
@end
-
-@implementation WKToolTipDelegate
-
-- (id)initWithPage:(WebPageProxy *)page
-{
- self = [super init];
- if (!self)
- return nil;
- _page = page;
- return self;
-}
-
-- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data
-{
- return nsStringFromWebCoreString(_page->toolTip());
-}
-
-@end
diff --git a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
index 08009b9da..9dfe29b00 100644
--- a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
@@ -31,6 +31,7 @@
#include "WebContext.h"
#include "WebNotification.h"
#include "WebNotificationManagerMessages.h"
+#include "WebNotificationManagerProxyMessages.h"
#include "WebPageProxy.h"
#include "WebSecurityOrigin.h"
@@ -47,7 +48,7 @@ PassRefPtr<WebNotificationManagerProxy> WebNotificationManagerProxy::create(WebC
WebNotificationManagerProxy::WebNotificationManagerProxy(WebContext* context)
: m_context(context)
{
- m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebNotificationManagerProxy, this);
+ m_context->addMessageReceiver(Messages::WebNotificationManagerProxy::messageReceiverName(), this);
}
void WebNotificationManagerProxy::invalidate()
diff --git a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
index de668ab0e..474f06dac 100644
--- a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
@@ -28,6 +28,7 @@
#include "SecurityOriginData.h"
#include "WebApplicationCacheManagerMessages.h"
+#include "WebApplicationCacheManagerProxyMessages.h"
#include "WebContext.h"
#include "WebSecurityOrigin.h"
@@ -41,7 +42,7 @@ PassRefPtr<WebApplicationCacheManagerProxy> WebApplicationCacheManagerProxy::cre
WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebApplicationCacheManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebApplicationCacheManagerProxy::messageReceiverName(), this);
}
WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp b/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp
index 44b5aca0a..01eb98052 100644
--- a/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp
@@ -29,6 +29,7 @@
#if ENABLE(BATTERY_STATUS)
#include "WebBatteryManagerMessages.h"
+#include "WebBatteryManagerProxyMessages.h"
#include "WebContext.h"
namespace WebKit {
@@ -42,7 +43,7 @@ WebBatteryManagerProxy::WebBatteryManagerProxy(WebContext* context)
: m_isUpdating(false)
, m_context(context)
{
- m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebBatteryManagerProxy, this);
+ m_context->addMessageReceiver(Messages::WebBatteryManagerProxy::messageReceiverName(), this);
}
WebBatteryManagerProxy::~WebBatteryManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
index ff43b3411..6202608bd 100644
--- a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
+++ b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
@@ -59,7 +59,9 @@ void WebConnectionToWebProcess::encodeMessageBody(CoreIPC::ArgumentEncoder& enco
bool WebConnectionToWebProcess::decodeMessageBody(CoreIPC::ArgumentDecoder& decoder, RefPtr<APIObject>& messageBody)
{
- if (!decoder.decode(WebContextUserMessageDecoder(messageBody, m_process)))
+ WebContextUserMessageDecoder messageBodyDecoder(messageBody, m_process);
+
+ if (!decoder.decode(messageBodyDecoder))
return false;
return true;
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index 76cb514b9..56a017c6f 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -27,6 +27,7 @@
#include "WebContext.h"
#include "DownloadProxy.h"
+#include "DownloadProxyMessages.h"
#include "ImmutableArray.h"
#include "Logging.h"
#include "MutableDictionary.h"
@@ -36,6 +37,7 @@
#include "WKContextPrivate.h"
#include "WebApplicationCacheManagerProxy.h"
#include "WebContextMessageKinds.h"
+#include "WebContextMessages.h"
#include "WebContextUserMessageCoders.h"
#include "WebCookieManagerProxy.h"
#include "WebCoreArgumentCoders.h"
@@ -133,9 +135,9 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
, m_usesNetworkProcess(false)
#endif
{
- deprecatedAddMessageReceiver(CoreIPC::MessageClassWebContext, this);
- deprecatedAddMessageReceiver(CoreIPC::MessageClassDownloadProxy, this);
- deprecatedAddMessageReceiver(CoreIPC::MessageClassWebContextLegacy, this);
+ addMessageReceiver(Messages::WebContext::messageReceiverName(), this);
+ addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), this);
+ addMessageReceiver(CoreIPC::MessageKindTraits<WebContextLegacyMessage::Kind>::messageReceiverName(), this);
// NOTE: These sub-objects must be initialized after m_messageReceiverMap..
m_applicationCacheManagerProxy = WebApplicationCacheManagerProxy::create(this);
@@ -783,9 +785,9 @@ HashSet<String, CaseFoldingHash> WebContext::pdfAndPostScriptMIMETypes()
return mimeTypes;
}
-void WebContext::deprecatedAddMessageReceiver(CoreIPC::MessageClass messageClass, CoreIPC::MessageReceiver* messageReceiver)
+void WebContext::addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver* messageReceiver)
{
- m_messageReceiverMap.deprecatedAddMessageReceiver(messageClass, messageReceiver);
+ m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
}
bool WebContext::dispatchMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
@@ -816,10 +818,12 @@ void WebContext::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
case WebContextLegacyMessage::PostMessage: {
String messageName;
RefPtr<APIObject> messageBody;
- WebContextUserMessageDecoder messageDecoder(messageBody, WebProcessProxy::fromConnection(connection));
- if (!decoder.decode(CoreIPC::Out(messageName, messageDecoder)))
+ WebContextUserMessageDecoder messageBodyDecoder(messageBody, WebProcessProxy::fromConnection(connection));
+ if (!decoder.decode(messageName))
return;
-
+ if (!decoder.decode(messageBodyDecoder))
+ return;
+
didReceiveMessageFromInjectedBundle(messageName, messageBody.get());
return;
}
@@ -849,13 +853,15 @@ void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC:
String messageName;
RefPtr<APIObject> messageBody;
- WebContextUserMessageDecoder messageDecoder(messageBody, WebProcessProxy::fromConnection(connection));
- if (!decoder.decode(CoreIPC::Out(messageName, messageDecoder)))
+ WebContextUserMessageDecoder messageBodyDecoder(messageBody, WebProcessProxy::fromConnection(connection));
+ if (!decoder.decode(messageName))
+ return;
+ if (!decoder.decode(messageBodyDecoder))
return;
RefPtr<APIObject> returnData;
didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody.get(), returnData);
- replyEncoder->encode(CoreIPC::In(WebContextUserMessageEncoder(returnData.get())));
+ replyEncoder->encode(WebContextUserMessageEncoder(returnData.get()));
return;
}
case WebContextLegacyMessage::PostMessage:
diff --git a/Source/WebKit2/UIProcess/WebContext.h b/Source/WebKit2/UIProcess/WebContext.h
index e3f6a69db..93dc68e70 100644
--- a/Source/WebKit2/UIProcess/WebContext.h
+++ b/Source/WebKit2/UIProcess/WebContext.h
@@ -86,7 +86,7 @@ public:
static const Vector<WebContext*>& allContexts();
- void deprecatedAddMessageReceiver(CoreIPC::MessageClass, CoreIPC::MessageReceiver*);
+ void addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver*);
bool dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
bool dispatchSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
diff --git a/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp b/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
index 6f876cfcc..b63c80c7e 100644
--- a/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
@@ -27,8 +27,9 @@
#include "WebCookieManagerProxy.h"
#include "SecurityOriginData.h"
-#include "WebCookieManagerMessages.h"
#include "WebContext.h"
+#include "WebCookieManagerMessages.h"
+#include "WebCookieManagerProxyMessages.h"
#include "WebSecurityOrigin.h"
namespace WebKit {
@@ -41,7 +42,7 @@ PassRefPtr<WebCookieManagerProxy> WebCookieManagerProxy::create(WebContext* cont
WebCookieManagerProxy::WebCookieManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebCookieManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), this);
}
WebCookieManagerProxy::~WebCookieManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
index 8f24028cb..116fd56e6 100644
--- a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
@@ -30,8 +30,9 @@
#include "ImmutableArray.h"
#include "ImmutableDictionary.h"
-#include "WebDatabaseManagerMessages.h"
#include "WebContext.h"
+#include "WebDatabaseManagerMessages.h"
+#include "WebDatabaseManagerProxyMessages.h"
#include "WebSecurityOrigin.h"
using namespace WebCore;
@@ -94,7 +95,7 @@ PassRefPtr<WebDatabaseManagerProxy> WebDatabaseManagerProxy::create(WebContext*
WebDatabaseManagerProxy::WebDatabaseManagerProxy(WebContext* webContext)
: m_webContext(webContext)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebDatabaseManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebDatabaseManagerProxy::messageReceiverName(), this);
}
WebDatabaseManagerProxy::~WebDatabaseManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp b/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
index 6cccd849c..74b90797f 100644
--- a/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
@@ -28,6 +28,7 @@
#include "WebContext.h"
#include "WebGeolocationManagerMessages.h"
+#include "WebGeolocationManagerProxyMessages.h"
namespace WebKit {
@@ -40,7 +41,7 @@ WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebContext* context)
: m_isUpdating(false)
, m_context(context)
{
- m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebGeolocationManagerProxy, this);
+ m_context->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), this);
}
WebGeolocationManagerProxy::~WebGeolocationManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebIconDatabase.cpp b/Source/WebKit2/UIProcess/WebIconDatabase.cpp
index 1092b9ac5..40158f4a0 100644
--- a/Source/WebKit2/UIProcess/WebIconDatabase.cpp
+++ b/Source/WebKit2/UIProcess/WebIconDatabase.cpp
@@ -29,6 +29,7 @@
#include "DataReference.h"
#include "Logging.h"
#include "WebContext.h"
+#include "WebIconDatabaseMessages.h"
#include "WebIconDatabaseProxyMessages.h"
#include <WebCore/FileSystem.h>
#include <WebCore/IconDatabase.h>
@@ -54,7 +55,7 @@ WebIconDatabase::WebIconDatabase(WebContext* context)
, m_urlImportCompleted(false)
, m_databaseCleanupDisabled(false)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebIconDatabase, this);
+ m_webContext->addMessageReceiver(Messages::WebIconDatabase::messageReceiverName(), this);
}
void WebIconDatabase::invalidate()
diff --git a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
index 5c3088d98..43f69a445 100644
--- a/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
@@ -27,8 +27,9 @@
#include "WebKeyValueStorageManagerProxy.h"
#include "SecurityOriginData.h"
-#include "WebKeyValueStorageManagerMessages.h"
#include "WebContext.h"
+#include "WebKeyValueStorageManagerMessages.h"
+#include "WebKeyValueStorageManagerProxyMessages.h"
#include "WebSecurityOrigin.h"
namespace WebKit {
@@ -41,7 +42,7 @@ PassRefPtr<WebKeyValueStorageManagerProxy> WebKeyValueStorageManagerProxy::creat
WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebKeyValueStorageManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebKeyValueStorageManagerProxy::messageReceiverName(), this);
}
WebKeyValueStorageManagerProxy::~WebKeyValueStorageManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
index 39cf73a89..b0f9bd196 100644
--- a/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
@@ -28,6 +28,7 @@
#include "WebContext.h"
#include "WebMediaCacheManagerMessages.h"
+#include "WebMediaCacheManagerProxyMessages.h"
#include "WebSecurityOrigin.h"
namespace WebKit {
@@ -40,7 +41,7 @@ PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebConte
WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context)
: m_webContext(context)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebMediaCacheManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebMediaCacheManagerProxy::messageReceiverName(), this);
}
WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp b/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp
index 7f30a5340..4173463f4 100644
--- a/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp
@@ -31,6 +31,7 @@
#include "WebContext.h"
#include "WebNetworkInfo.h"
#include "WebNetworkInfoManagerMessages.h"
+#include "WebNetworkInfoManagerProxyMessages.h"
namespace WebKit {
@@ -43,7 +44,7 @@ WebNetworkInfoManagerProxy::WebNetworkInfoManagerProxy(WebContext* context)
: m_isUpdating(false)
, m_context(context)
{
- m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebNetworkInfoManagerProxy, this);
+ m_context->addMessageReceiver(Messages::WebNetworkInfoManagerProxy::messageReceiverName(), this);
}
WebNetworkInfoManagerProxy::~WebNetworkInfoManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.h b/Source/WebKit2/UIProcess/WebProcessProxy.h
index 29dc5498f..afa5bd4b2 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.h
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.h
@@ -221,7 +221,7 @@ private:
template<typename E, typename T>
bool WebProcessProxy::deprecatedSend(E messageID, uint64_t destinationID, const T& arguments)
{
- OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create("", "", destinationID);
+ OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create(CoreIPC::MessageKindTraits<E>::messageReceiverName(), "", destinationID);
encoder->encode(arguments);
return sendMessage(CoreIPC::MessageID(messageID), encoder.release(), 0);
@@ -230,7 +230,7 @@ bool WebProcessProxy::deprecatedSend(E messageID, uint64_t destinationID, const
template<typename T>
bool WebProcessProxy::send(const T& message, uint64_t destinationID, unsigned messageSendFlags)
{
- OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create("", "", destinationID);
+ OwnPtr<CoreIPC::MessageEncoder> encoder = CoreIPC::MessageEncoder::create(T::receiverName(), "", destinationID);
encoder->encode(message);
return sendMessage(CoreIPC::MessageID(T::messageID), encoder.release(), messageSendFlags);
diff --git a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
index fcb056db0..22a41a12d 100644
--- a/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
@@ -31,6 +31,7 @@
#include "SecurityOriginData.h"
#include "WebContext.h"
#include "WebResourceCacheManagerMessages.h"
+#include "WebResourceCacheManagerProxyMessages.h"
#include "WebSecurityOrigin.h"
using namespace WebCore;
@@ -45,7 +46,7 @@ PassRefPtr<WebResourceCacheManagerProxy> WebResourceCacheManagerProxy::create(We
WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebContext* webContext)
: m_webContext(webContext)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebResourceCacheManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebResourceCacheManagerProxy::messageReceiverName(), this);
}
WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()
diff --git a/Source/WebKit2/UIProcess/WebVibrationProxy.cpp b/Source/WebKit2/UIProcess/WebVibrationProxy.cpp
index 6b0717c18..4a645d543 100644
--- a/Source/WebKit2/UIProcess/WebVibrationProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebVibrationProxy.cpp
@@ -29,6 +29,7 @@
#if ENABLE(VIBRATION)
#include "WebContext.h"
+#include "WebVibrationProxyMessages.h"
namespace WebKit {
@@ -40,7 +41,7 @@ PassRefPtr<WebVibrationProxy> WebVibrationProxy::create(WebContext* context)
WebVibrationProxy::WebVibrationProxy(WebContext* context)
: m_context(context)
{
- m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebVibrationProxy, this);
+ m_context->addMessageReceiver(Messages::WebVibrationProxy::messageReceiverName(), this);
}
WebVibrationProxy::~WebVibrationProxy()
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp
index 0d6d5a347..2425b157d 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
+++ b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp
@@ -24,106 +24,107 @@
*/
#include "config.h"
-#include "ewk_view.h"
+#include "PageLoadClientEfl.h"
#include "WKFrame.h"
+#include "WKPage.h"
#include "ewk_back_forward_list_private.h"
#include "ewk_error_private.h"
-#include "ewk_intent.h"
#include "ewk_intent_private.h"
-#include "ewk_intent_service.h"
#include "ewk_intent_service_private.h"
-#include "ewk_view_loader_client_private.h"
-#include "ewk_view_private.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/text/CString.h>
+#include "ewk_view.h"
-using namespace WebKit;
+namespace WebKit {
-static void didReceiveTitleForFrame(WKPageRef, WKStringRef title, WKFrameRef frame, WKTypeRef, const void* clientInfo)
+static inline PageLoadClientEfl* toPageLoadClientEfl(const void* clientInfo)
+{
+ return static_cast<PageLoadClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void PageLoadClientEfl::didReceiveTitleForFrame(WKPageRef, WKStringRef title, WKFrameRef frame, WKTypeRef, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ewk_view_title_changed(ewkView, toImpl(title)->string().utf8().data());
}
#if ENABLE(WEB_INTENTS)
-static void didReceiveIntentForFrame(WKPageRef, WKFrameRef, WKIntentDataRef intent, WKTypeRef, const void* clientInfo)
+void PageLoadClientEfl::didReceiveIntentForFrame(WKPageRef, WKFrameRef, WKIntentDataRef intent, WKTypeRef, const void* clientInfo)
{
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
RefPtr<Ewk_Intent> ewkIntent = Ewk_Intent::create(intent);
ewk_view_intent_request_new(ewkView, ewkIntent.get());
}
#endif
#if ENABLE(WEB_INTENTS_TAG)
-static void registerIntentServiceForFrame(WKPageRef, WKFrameRef, WKIntentServiceInfoRef serviceInfo, WKTypeRef, const void *clientInfo)
+void PageLoadClientEfl::registerIntentServiceForFrame(WKPageRef, WKFrameRef, WKIntentServiceInfoRef serviceInfo, WKTypeRef, const void* clientInfo)
{
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
RefPtr<Ewk_Intent_Service> ewkIntentService = Ewk_Intent_Service::create(serviceInfo);
ewk_view_intent_service_register(ewkView, ewkIntentService.get());
}
#endif
-static void didChangeProgress(WKPageRef page, const void* clientInfo)
+void PageLoadClientEfl::didChangeProgress(WKPageRef page, const void* clientInfo)
{
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ewk_view_load_progress_changed(ewkView, WKPageGetEstimatedProgress(page));
}
-static void didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void *clientInfo)
+void PageLoadClientEfl::didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ewk_view_load_finished(ewkView);
}
-static void didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void *clientInfo)
+void PageLoadClientEfl::didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
ewk_view_load_error(ewkView, ewkError.get());
ewk_view_load_finished(ewkView);
}
-static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
+void PageLoadClientEfl::didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ewk_view_load_provisional_started(ewkView);
}
-static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
+void PageLoadClientEfl::didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ewk_view_load_provisional_redirect(ewkView);
}
-static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void* clientInfo)
+void PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
ewk_view_load_provisional_failed(ewkView, ewkError.get());
}
-static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
+void PageLoadClientEfl::didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
{
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ASSERT(ewkView);
Ewk_Back_Forward_List* list = ewk_view_back_forward_list_get(ewkView);
@@ -133,21 +134,25 @@ static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedIt
ewk_view_back_forward_list_changed(ewkView);
}
-static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef frame, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo)
+void PageLoadClientEfl::didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef frame, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
ewk_view_url_update(ewkView);
}
-void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
+PageLoadClientEfl::PageLoadClientEfl(Evas_Object* view)
+ : m_view(view)
{
+ WKPageRef pageRef = ewk_view_wkpage_get(m_view);
+ ASSERT(pageRef);
+
WKPageLoaderClient loadClient;
memset(&loadClient, 0, sizeof(WKPageLoaderClient));
loadClient.version = kWKPageLoaderClientCurrentVersion;
- loadClient.clientInfo = ewkView;
+ loadClient.clientInfo = this;
loadClient.didReceiveTitleForFrame = didReceiveTitleForFrame;
#if ENABLE(WEB_INTENTS)
loadClient.didReceiveIntentForFrame = didReceiveIntentForFrame;
@@ -167,3 +172,5 @@ void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
loadClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
WKPageSetPageLoaderClient(pageRef, &loadClient);
}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h
new file mode 100644
index 000000000..68cc17d6a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PageLoadClientEfl_h
+#define PageLoadClientEfl_h
+
+#include "ewk_view_private.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class PageLoadClientEfl {
+public:
+ static PassOwnPtr<PageLoadClientEfl> create(Evas_Object* view)
+ {
+ return adoptPtr(new PageLoadClientEfl(view));
+ }
+
+private:
+ explicit PageLoadClientEfl(Evas_Object* view);
+
+ inline Evas_Object* view() const { return m_view; }
+
+ static void didReceiveTitleForFrame(WKPageRef, WKStringRef title, WKFrameRef, WKTypeRef, const void* clientInfo);
+#if ENABLE(WEB_INTENTS)
+ static void didReceiveIntentForFrame(WKPageRef, WKFrameRef, WKIntentDataRef, WKTypeRef, const void* clientInfo);
+#endif
+#if ENABLE(WEB_INTENTS_TAG)
+ static void registerIntentServiceForFrame(WKPageRef, WKFrameRef, WKIntentServiceInfoRef, WKTypeRef, const void* clientInfo);
+#endif
+ static void didChangeProgress(WKPageRef, const void* clientInfo);
+ static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
+ static void didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
+ static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
+ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
+ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
+ static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo);
+ static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo);
+
+ Evas_Object* m_view;
+};
+
+} // namespace WebKit
+
+#endif // PageLoadClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp
new file mode 100644
index 000000000..6539cce36
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ResourceLoadClientEfl.h"
+
+#include "WKAPICast.h"
+#include "WKFrame.h"
+#include "WKPage.h"
+#include "WKRetainPtr.h"
+#include "ewk_error_private.h"
+#include "ewk_url_request_private.h"
+#include "ewk_url_response_private.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static inline ResourceLoadClientEfl* toResourceLoadClientEfl(const void* clientInfo)
+{
+ return static_cast<ResourceLoadClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void ResourceLoadClientEfl::didInitiateLoadForResource(WKPageRef, WKFrameRef wkFrame, uint64_t resourceIdentifier, WKURLRequestRef wkRequest, bool pageIsProvisionallyLoading, const void* clientInfo)
+{
+ ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
+ bool isMainResource = (WKFrameIsMainFrame(wkFrame) && pageIsProvisionallyLoading);
+ WKRetainPtr<WKURLRef> wkUrl(AdoptWK, WKURLRequestCopyURL(wkRequest));
+
+ RefPtr<Ewk_Resource> resource = Ewk_Resource::create(wkUrl.get(), isMainResource);
+
+ // Keep the resource internally to reuse it later.
+ resourceLoadClient->m_loadingResourcesMap.add(resourceIdentifier, resource);
+
+ RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(wkRequest);
+ ewk_view_resource_load_initiated(resourceLoadClient->m_view, resource.get(), request.get());
+}
+
+void ResourceLoadClientEfl::didSendRequestForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef wkRequest, WKURLResponseRef wkRedirectResponse, const void* clientInfo)
+{
+ ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
+
+ RefPtr<Ewk_Resource> resource = resourceLoadClient->m_loadingResourcesMap.get(resourceIdentifier);
+ // Only process if we know about this resource.
+ if (!resource)
+ return;
+
+ RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(wkRequest);
+ RefPtr<Ewk_Url_Response> redirectResponse = Ewk_Url_Response::create(wkRedirectResponse);
+ ewk_view_resource_request_sent(resourceLoadClient->m_view, resource.get(), request.get(), redirectResponse.get());
+}
+
+void ResourceLoadClientEfl::didReceiveResponseForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLResponseRef wkResponse, const void* clientInfo)
+{
+ ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
+
+ RefPtr<Ewk_Resource> resource = resourceLoadClient->m_loadingResourcesMap.get(resourceIdentifier);
+ // Only process if we know about this resource.
+ if (!resource)
+ return;
+
+ RefPtr<Ewk_Url_Response> response = Ewk_Url_Response::create(wkResponse);
+ ewk_view_resource_load_response(resourceLoadClient->m_view, resource.get(), response.get());
+}
+
+void ResourceLoadClientEfl::didFinishLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, const void* clientInfo)
+{
+ ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
+
+ RefPtr<Ewk_Resource> resource = resourceLoadClient->m_loadingResourcesMap.get(resourceIdentifier);
+ // Only process if we know about this resource.
+ if (!resource)
+ return;
+
+ ewk_view_resource_load_finished(resourceLoadClient->m_view, resource.get());
+}
+
+void ResourceLoadClientEfl::didFailLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKErrorRef wkError, const void* clientInfo)
+{
+ ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
+
+ RefPtr<Ewk_Resource> resource = resourceLoadClient->m_loadingResourcesMap.take(resourceIdentifier);
+ // Only process if we know about this resource.
+ if (!resource)
+ return;
+
+ OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(wkError);
+ ewk_view_resource_load_failed(resourceLoadClient->m_view, resource.get(), ewkError.get());
+ ewk_view_resource_load_finished(resourceLoadClient->m_view, resource.get());
+}
+
+void ResourceLoadClientEfl::onViewProvisionalLoadStarted(void* userData, Evas_Object*, void*)
+{
+ ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(userData);
+
+ // The view started a new load, clear internal resource map.
+ resourceLoadClient->m_loadingResourcesMap.clear();
+}
+
+ResourceLoadClientEfl::ResourceLoadClientEfl(Evas_Object* view)
+ : m_view(view)
+{
+ // Listen for "load,provisional,started" on the view to clear internal resources map.
+ evas_object_smart_callback_add(m_view, "load,provisional,started", onViewProvisionalLoadStarted, this);
+
+ WKPageRef pageRef = ewk_view_wkpage_get(m_view);
+ ASSERT(pageRef);
+
+ WKPageResourceLoadClient wkResourceLoadClient;
+ memset(&wkResourceLoadClient, 0, sizeof(WKPageResourceLoadClient));
+ wkResourceLoadClient.version = kWKPageResourceLoadClientCurrentVersion;
+ wkResourceLoadClient.clientInfo = this;
+ wkResourceLoadClient.didInitiateLoadForResource = didInitiateLoadForResource;
+ wkResourceLoadClient.didSendRequestForResource = didSendRequestForResource;
+ wkResourceLoadClient.didReceiveResponseForResource = didReceiveResponseForResource;
+ wkResourceLoadClient.didFinishLoadForResource = didFinishLoadForResource;
+ wkResourceLoadClient.didFailLoadForResource = didFailLoadForResource;
+
+ WKPageSetPageResourceLoadClient(pageRef, &wkResourceLoadClient);
+}
+
+ResourceLoadClientEfl::~ResourceLoadClientEfl()
+{
+ evas_object_smart_callback_del(m_view, "load,provisional,started", onViewProvisionalLoadStarted);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h
new file mode 100644
index 000000000..58f52b4b7
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ResourceLoadClientEfl_h
+#define ResourceLoadClientEfl_h
+
+#include "ewk_resource_private.h"
+#include "ewk_view_private.h"
+#include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class ResourceLoadClientEfl {
+public:
+ ~ResourceLoadClientEfl();
+
+ static PassOwnPtr<ResourceLoadClientEfl> create(Evas_Object* view)
+ {
+ return adoptPtr(new ResourceLoadClientEfl(view));
+ }
+
+private:
+ explicit ResourceLoadClientEfl(Evas_Object* view);
+
+ static void didInitiateLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef, bool pageIsProvisionallyLoading, const void* clientInfo);
+ static void didSendRequestForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef, WKURLResponseRef, const void* clientInfo);
+ static void didReceiveResponseForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLResponseRef, const void* clientInfo);
+ static void didFinishLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
+ static void didFailLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKErrorRef, const void* clientInfo);
+
+ static void onViewProvisionalLoadStarted(void* userData, Evas_Object* view, void* clientInfo);
+
+ Evas_Object* m_view;
+ HashMap< uint64_t, RefPtr<Ewk_Resource> > m_loadingResourcesMap;
+};
+
+} // namespace WebKit
+
+#endif // ResourceLoadClientEfl_h
diff --git a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
index 679be2bed..33698cd7c 100644
--- a/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp
@@ -23,6 +23,7 @@
#include "WebContext.h"
#include "WebData.h"
#include "WebSoupRequestManagerMessages.h"
+#include "WebSoupRequestManagerProxyMessages.h"
namespace WebKit {
@@ -35,7 +36,7 @@ WebSoupRequestManagerProxy::WebSoupRequestManagerProxy(WebContext* context)
: m_webContext(context)
, m_loadFailed(false)
{
- m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebSoupRequestManagerProxy, this);
+ m_webContext->addMessageReceiver(Messages::WebSoupRequestManagerProxy::messageReceiverName(), this);
}
WebSoupRequestManagerProxy::~WebSoupRequestManagerProxy()