Diff
Modified: trunk/Source/WebKit2/ChangeLog (140308 => 140309)
--- trunk/Source/WebKit2/ChangeLog 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/ChangeLog 2013-01-21 08:18:18 UTC (rev 140309)
@@ -1,3 +1,31 @@
+2013-01-21 Thiago Marcos P. Santos <[email protected]>
+
+ REGRESSION (r140285): EFL uses WKPageResourceLoadClient which was removed
+ https://bugs.webkit.org/show_bug.cgi?id=107417
+
+ Reviewed by Gyuyoung Kim.
+
+ We had no choice but remove the ResourceLoadClientEfl after r140285
+ and thus our public API signals depending on it. The test_ewk2_auth_request
+ unit test was skipped because it depends these signals and will be fixed in a
+ different patch.
+
+ * PlatformEfl.cmake:
+ * UIProcess/API/efl/EWebKit2.h:
+ * UIProcess/API/efl/EwkViewCallbacks.h:
+ * UIProcess/API/efl/EwkViewImpl.cpp:
+ (EwkViewImpl::EwkViewImpl):
+ * UIProcess/API/efl/EwkViewImpl.h:
+ (WebKit):
+ (EwkViewImpl):
+ * UIProcess/API/efl/ewk_resource.cpp: Removed.
+ * UIProcess/API/efl/ewk_resource.h: Removed.
+ * UIProcess/API/efl/ewk_resource_private.h: Removed.
+ * UIProcess/API/efl/ewk_view.cpp:
+ * UIProcess/API/efl/ewk_view.h:
+ * UIProcess/efl/ResourceLoadClientEfl.cpp: Removed.
+ * UIProcess/efl/ResourceLoadClientEfl.h: Removed.
+
2013-01-20 Viatcheslav Ostapenko <[email protected]>
Remove support getting per-resource callbacks in the UIProcess
Modified: trunk/Source/WebKit2/PlatformEfl.cmake (140308 => 140309)
--- trunk/Source/WebKit2/PlatformEfl.cmake 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/PlatformEfl.cmake 2013-01-21 08:18:18 UTC (rev 140309)
@@ -65,7 +65,6 @@
UIProcess/API/efl/ewk_object.cpp
UIProcess/API/efl/ewk_popup_menu.cpp
UIProcess/API/efl/ewk_popup_menu_item.cpp
- UIProcess/API/efl/ewk_resource.cpp
UIProcess/API/efl/ewk_security_origin.cpp
UIProcess/API/efl/ewk_settings.cpp
UIProcess/API/efl/ewk_storage_manager.cpp
@@ -94,7 +93,6 @@
UIProcess/efl/PageUIClientEfl.cpp
UIProcess/efl/PageViewportControllerClientEfl.cpp
UIProcess/efl/RequestManagerClientEfl.cpp
- UIProcess/efl/ResourceLoadClientEfl.cpp
UIProcess/efl/TextCheckerEfl.cpp
UIProcess/efl/VibrationClientEfl.cpp
UIProcess/efl/WebContextEfl.cpp
@@ -283,7 +281,6 @@
"${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_object.h"
"${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu.h"
"${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu_item.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_resource.h"
"${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_security_origin.h"
"${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_settings.h"
"${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_storage_manager.h"
@@ -366,7 +363,6 @@
# The "ewk" on the test name needs to be suffixed with "2", otherwise it
# will clash with tests from the WebKit 1 test suite.
set(EWK2UnitTests_BINARIES
- test_ewk2_auth_request
test_ewk2_back_forward_list
test_ewk2_color_picker
test_ewk2_context
@@ -389,6 +385,11 @@
test_ewk2_window_features
)
+# Skipped unit tests list:
+#
+# webkit.org/b/107422: test_ewk2_auth_request
+#
+
if (ENABLE_API_TESTS)
foreach (testName ${EWK2UnitTests_BINARIES})
add_executable(${testName} ${WEBKIT2_EFL_TEST_DIR}/${testName}.cpp)
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -50,7 +50,6 @@
#include "ewk_object.h"
#include "ewk_popup_menu.h"
#include "ewk_popup_menu_item.h"
-#include "ewk_resource.h"
#include "ewk_security_origin.h"
#include "ewk_settings.h"
#include "ewk_storage_manager.h"
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -38,7 +38,6 @@
typedef struct EwkObject Ewk_File_Chooser_Request;
typedef struct EwkObject Ewk_Form_Submission_Request;
typedef struct EwkObject Ewk_Navigation_Policy_Decision;
-typedef struct EwkObject Ewk_Resource;
#if ENABLE(WEB_INTENTS)
typedef struct EwkObject Ewk_Intent;
#endif
@@ -48,9 +47,6 @@
typedef struct EwkError Ewk_Error;
struct Ewk_Download_Job_Error;
-struct Ewk_Resource_Request;
-struct Ewk_Resource_Load_Response;
-struct Ewk_Resource_Load_Error;
struct Ewk_CSS_Size;
namespace EwkViewCallbacks {
@@ -74,11 +70,6 @@
ProvisionalLoadFailed,
ProvisionalLoadRedirect,
ProvisionalLoadStarted,
- ResourceLoadStarted,
- ResourceLoadResponse,
- ResourceLoadFailed,
- ResourceLoadFinished,
- ResourceRequestSent,
StatusBarVisible,
NavigationPolicyDecision,
NewWindowPolicyDecision,
@@ -197,11 +188,6 @@
DECLARE_EWK_VIEW_CALLBACK(MenuBarVisible, "menubar,visible", bool*);
DECLARE_EWK_VIEW_CALLBACK(NavigationPolicyDecision, "policy,decision,navigation", Ewk_Navigation_Policy_Decision*);
DECLARE_EWK_VIEW_CALLBACK(NewWindowPolicyDecision, "policy,decision,new,window", Ewk_Navigation_Policy_Decision*);
-DECLARE_EWK_VIEW_CALLBACK(ResourceLoadStarted, "resource,request,new", Ewk_Resource_Request*);
-DECLARE_EWK_VIEW_CALLBACK(ResourceLoadResponse, "resource,request,response", Ewk_Resource_Load_Response*);
-DECLARE_EWK_VIEW_CALLBACK(ResourceLoadFailed, "resource,request,failed", Ewk_Resource_Load_Error*);
-DECLARE_EWK_VIEW_CALLBACK(ResourceLoadFinished, "resource,request,finished", Ewk_Resource*);
-DECLARE_EWK_VIEW_CALLBACK(ResourceRequestSent, "resource,request,sent", Ewk_Resource_Request*);
DECLARE_EWK_VIEW_CALLBACK(StatusBarVisible, "statusbar,visible", bool*);
DECLARE_EWK_VIEW_CALLBACK(TextFound, "text,found", unsigned*);
DECLARE_EWK_VIEW_CALLBACK(TitleChange, "title,changed", const char*);
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp 2013-01-21 08:18:18 UTC (rev 140309)
@@ -34,7 +34,6 @@
#include "PageLoadClientEfl.h"
#include "PagePolicyClientEfl.h"
#include "PageUIClientEfl.h"
-#include "ResourceLoadClientEfl.h"
#include "SnapshotImageGL.h"
#include "WKDictionary.h"
#include "WKGeometry.h"
@@ -122,7 +121,6 @@
, m_pageLoadClient(PageLoadClientEfl::create(this))
, m_pagePolicyClient(PagePolicyClientEfl::create(this))
, m_pageUIClient(PageUIClientEfl::create(this))
- , m_resourceLoadClient(ResourceLoadClientEfl::create(this))
, m_contextMenuClient(ContextMenuClientEfl::create(this))
, m_findClient(FindClientEfl::create(this))
, m_formClient(FormClientEfl::create(this))
Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -58,7 +58,6 @@
class PageLoadClientEfl;
class PagePolicyClientEfl;
class PageUIClientEfl;
-class ResourceLoadClientEfl;
class WebContextMenuItemData;
class WebContextMenuProxyEfl;
class WebPageGroup;
@@ -255,7 +254,6 @@
OwnPtr<WebKit::PageLoadClientEfl> m_pageLoadClient;
OwnPtr<WebKit::PagePolicyClientEfl> m_pagePolicyClient;
OwnPtr<WebKit::PageUIClientEfl> m_pageUIClient;
- OwnPtr<WebKit::ResourceLoadClientEfl> m_resourceLoadClient;
OwnPtr<WebKit::ContextMenuClientEfl> m_contextMenuClient;
OwnPtr<WebKit::FindClientEfl> m_findClient;
OwnPtr<WebKit::FormClientEfl> m_formClient;
Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource.cpp 2013-01-21 08:18:18 UTC (rev 140309)
@@ -1,59 +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 "ewk_resource.h"
-
-#include "ewk_resource_private.h"
-#include <wtf/text/CString.h>
-
-EwkResource::EwkResource(WKURLRef url, bool isMainResource)
- : m_url(url)
- , m_isMainResource(isMainResource)
-{ }
-
-const char* EwkResource::url() const
-{
- return m_url;
-}
-
-bool EwkResource::isMainResource() const
-{
- return m_isMainResource;
-}
-
-const char* ewk_resource_url_get(const Ewk_Resource* resource)
-{
- EWK_OBJ_GET_IMPL_OR_RETURN(const EwkResource, resource, impl, 0);
-
- return impl->url();
-}
-
-Eina_Bool ewk_resource_main_resource_get(const Ewk_Resource* resource)
-{
- EWK_OBJ_GET_IMPL_OR_RETURN(const EwkResource, resource, impl, false);
-
- return impl->isMainResource();
-}
Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -1,73 +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.
- */
-
-/**
- * @file ewk_resource.h
- * @brief Describes the Web Resource API.
- */
-
-#ifndef ewk_resource_h
-#define ewk_resource_h
-
-#include <Eina.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Declare Ewk_Resource as Ewk_Object.
- *
- * @see Ewk_Object
- */
-typedef struct EwkObject Ewk_Resource;
-
-/**
- * Query URL for this resource.
- *
- * @param resource resource object to query.
- *
- * @return the URL pointer, that may be @c NULL. This pointer is
- * guaranteed to be eina_stringshare, so whenever possible
- * save yourself some cpu cycles and use
- * eina_stringshare_ref() instead of eina_stringshare_add() or
- * strdup().
- */
-EAPI const char *ewk_resource_url_get(const Ewk_Resource *resource);
-
-/**
- * Query if this is the main resource.
- *
- * @param resource resource object to query.
- *
- * @return @c EINA_TRUE if this is the main resource, @c EINA_FALSE otherwise
- */
-EAPI Eina_Bool ewk_resource_main_resource_get(const Ewk_Resource *resource);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ewk_resource_h
Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -1,55 +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_resource_private_h
-#define ewk_resource_private_h
-
-#include "WKEinaSharedString.h"
-#include "WKURL.h"
-#include "ewk_object_private.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-class EwkResource : public EwkObject {
-public:
- EWK_OBJECT_DECLARE(EwkResource)
-
- static PassRefPtr<EwkResource> create(WKURLRef url, bool isMainResource)
- {
- return adoptRef(new EwkResource(url, isMainResource));
- }
-
- const char* url() const;
- bool isMainResource() const;
-
-private:
- EwkResource(WKURLRef url, bool isMainResource);
-
- WKEinaSharedString m_url;
- bool m_isMainResource;
-};
-
-#endif // ewk_resource_private_h
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2013-01-21 08:18:18 UTC (rev 140309)
@@ -32,7 +32,6 @@
#include "PageLoadClientEfl.h"
#include "PagePolicyClientEfl.h"
#include "PageUIClientEfl.h"
-#include "ResourceLoadClientEfl.h"
#include "WKAPICast.h"
#include "WKEinaSharedString.h"
#include "WKFindOptions.h"
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -63,11 +63,6 @@
* - "policy,decision,new,window", Ewk_Navigation_Policy_Decision*: a new window policy decision should be taken.
* To make a policy decision asynchronously, simply increment the reference count of the
* #Ewk_Navigation_Policy_Decision object using ewk_navigation_policy_decision_ref().
- * - "resource,request,failed", const Ewk_Resource_Load_Error*: a resource failed loading.
- * - "resource,request,finished", const Ewk_Resource*: a resource finished loading.
- * - "resource,request,new", const Ewk_Resource_Request*: a resource request was initiated.
- * - "resource,request,response", Ewk_Resource_Load_Response*: a response to a resource request was received.
- * - "resource,request,sent", const Ewk_Resource_Request*: a resource request was sent.
* - "text,found", unsigned int*: the requested text was found and it gives the number of matches.
* - "title,changed", const char*: title of the main frame was changed.
* - "tooltip,text,set", const char*: tooltip was set.
@@ -88,7 +83,6 @@
#include "ewk_error.h"
#include "ewk_intent.h"
#include "ewk_popup_menu.h"
-#include "ewk_resource.h"
#include "ewk_security_origin.h"
#include "ewk_settings.h"
#include "ewk_touch.h"
@@ -231,42 +225,6 @@
} changed;
};
-/// Creates a type name for Ewk_Resource_Request.
-typedef struct Ewk_Resource_Request Ewk_Resource_Request;
-
-/**
- * @brief Structure containing details about a resource request.
- */
-struct Ewk_Resource_Request {
- Ewk_Resource *resource; /**< resource being requested */
- Ewk_Url_Request *request; /**< URL request for the resource */
- Ewk_Url_Response *redirect_response; /**< Possible redirect response for the resource or @c NULL */
-};
-
-/// Creates a type name for Ewk_Resource_Load_Response.
-typedef struct Ewk_Resource_Load_Response Ewk_Resource_Load_Response;
-
-/**
- * @brief Structure containing details about a response to a resource request.
- */
-struct Ewk_Resource_Load_Response {
- Ewk_Resource *resource; /**< resource requested */
- Ewk_Url_Response *response; /**< resource load response */
-};
-
-/// Creates a type name for Ewk_Resource_Load_Error.
-typedef struct Ewk_Resource_Load_Error Ewk_Resource_Load_Error;
-
-/**
- * @brief Structure containing details about a resource load error.
- *
- * Details given about a resource load failure.
- */
-struct Ewk_Resource_Load_Error {
- Ewk_Resource *resource; /**< resource that failed loading */
- Ewk_Error *error; /**< load error */
-};
-
/// Creates a type name for Ewk_Download_Job_Error.
typedef struct Ewk_Download_Job_Error Ewk_Download_Job_Error;
Deleted: trunk/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp 2013-01-21 08:18:18 UTC (rev 140309)
@@ -1,156 +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 "ResourceLoadClientEfl.h"
-
-#include "EwkViewImpl.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"
-#include "ewk_view.h"
-
-using namespace WebCore;
-using namespace EwkViewCallbacks;
-
-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<EwkResource> resource = EwkResource::create(wkUrl.get(), isMainResource);
-
- // Keep the resource internally to reuse it later.
- resourceLoadClient->m_loadingResourcesMap.add(resourceIdentifier, resource);
-
- RefPtr<EwkUrlRequest> request = EwkUrlRequest::create(wkRequest);
- Ewk_Resource_Request resourceRequest = {resource.get(), request.get(), 0};
- resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadStarted>().call(&resourceRequest);
-}
-
-void ResourceLoadClientEfl::didSendRequestForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef wkRequest, WKURLResponseRef wkRedirectResponse, const void* clientInfo)
-{
- ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
-
- RefPtr<EwkResource> resource = resourceLoadClient->m_loadingResourcesMap.get(resourceIdentifier);
- // Only process if we know about this resource.
- if (!resource)
- return;
-
- RefPtr<EwkUrlRequest> request = EwkUrlRequest::create(wkRequest);
- RefPtr<EwkUrlResponse> redirectResponse = EwkUrlResponse::create(wkRedirectResponse);
- Ewk_Resource_Request resourceRequest = {resource.get(), request.get(), redirectResponse.get()};
- resourceLoadClient->m_viewImpl->smartCallback<ResourceRequestSent>().call(&resourceRequest);
-}
-
-void ResourceLoadClientEfl::didReceiveResponseForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLResponseRef wkResponse, const void* clientInfo)
-{
- ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
-
- RefPtr<EwkResource> resource = resourceLoadClient->m_loadingResourcesMap.get(resourceIdentifier);
- // Only process if we know about this resource.
- if (!resource)
- return;
-
- RefPtr<EwkUrlResponse> response = EwkUrlResponse::create(wkResponse);
- Ewk_Resource_Load_Response resourceLoadResponse = {resource.get(), response.get()};
- resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadResponse>().call(&resourceLoadResponse);
-}
-
-void ResourceLoadClientEfl::didFinishLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, const void* clientInfo)
-{
- ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
-
- RefPtr<EwkResource> resource = resourceLoadClient->m_loadingResourcesMap.get(resourceIdentifier);
- // Only process if we know about this resource.
- if (!resource)
- return;
-
- resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadFinished>().call(resource.get());
-}
-
-void ResourceLoadClientEfl::didFailLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKErrorRef wkError, const void* clientInfo)
-{
- ResourceLoadClientEfl* resourceLoadClient = toResourceLoadClientEfl(clientInfo);
-
- RefPtr<EwkResource> resource = resourceLoadClient->m_loadingResourcesMap.take(resourceIdentifier);
- // Only process if we know about this resource.
- if (!resource)
- return;
-
- OwnPtr<EwkError> ewkError = EwkError::create(wkError);
- Ewk_Resource_Load_Error resourceLoadError = {resource.get(), ewkError.get()};
- resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadFailed>().call(&resourceLoadError);
- resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadFinished>().call(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(EwkViewImpl* viewImpl)
- : m_viewImpl(viewImpl)
-{
- // Listen for "load,provisional,started" on the view to clear internal resources map.
- evas_object_smart_callback_add(m_viewImpl->view(), CallBackInfo<ProvisionalLoadStarted>::name(), onViewProvisionalLoadStarted, this);
-
- WKPageRef pageRef = m_viewImpl->wkPage();
- 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_viewImpl->view(), CallBackInfo<ProvisionalLoadStarted>::name(), onViewProvisionalLoadStarted);
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h (140308 => 140309)
--- trunk/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h 2013-01-21 08:09:21 UTC (rev 140308)
+++ trunk/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h 2013-01-21 08:18:18 UTC (rev 140309)
@@ -1,64 +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 ResourceLoadClientEfl_h
-#define ResourceLoadClientEfl_h
-
-#include "ewk_resource.h"
-#include "ewk_resource_private.h"
-#include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
-
-class EwkViewImpl;
-
-namespace WebKit {
-
-class ResourceLoadClientEfl {
-public:
- ~ResourceLoadClientEfl();
-
- static PassOwnPtr<ResourceLoadClientEfl> create(EwkViewImpl* viewImpl)
- {
- return adoptPtr(new ResourceLoadClientEfl(viewImpl));
- }
-
-private:
- explicit ResourceLoadClientEfl(EwkViewImpl*);
-
- 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);
-
- EwkViewImpl* m_viewImpl;
- HashMap< uint64_t, RefPtr<EwkResource> > m_loadingResourcesMap;
-};
-
-} // namespace WebKit
-
-#endif // ResourceLoadClientEfl_h