WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch v3
bug92345_v3 (text/plain), 31.89 KB, created by
Mikhail Pozdnyakov
on 2012-07-27 07:49:43 PDT
(
hide
)
Description:
patch v3
Filename:
MIME Type:
Creator:
Mikhail Pozdnyakov
Created:
2012-07-27 07:49:43 PDT
Size:
31.89 KB
patch
obsolete
>commit d480a38b67e586d996f3b53ce2921e9cebec9598 >Author: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> >Date: Fri Jul 27 13:09:29 2012 +0300 > > bug92345 > >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 2190143..ed100d4 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,52 @@ >+2012-07-27 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> >+ >+ [EFL][WK2] Add back forward list API >+ https://bugs.webkit.org/show_bug.cgi?id=92345 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added new Back Forward list API to EFL WK2. Ewk_Back_Forward_List and >+ Ewk_Back_Forward_List_Item structures were added. The new API is >+ mostly the same as one from UIProcess/API/C/{ WKBackForwardList.h, WKBackForwardListItem.h }. >+ >+ * PlatformEfl.cmake: >+ * UIProcess/API/efl/ewk_back_forward_list.cpp: Added. >+ (_Ewk_Back_Forward_List): >+ (_Ewk_Back_Forward_List::_Ewk_Back_Forward_List): >+ (getOrCreateItem): >+ (webkit_back_forward_list_current_item_get): >+ (webkit_back_forward_list_back_item_get): >+ (webkit_back_forward_list_forward_item_get): >+ (webkit_back_forward_list_item_at_index_get): >+ (webkit_back_forward_list_length_get): >+ (ewk_back_forward_list_changed): >+ (ewk_back_forward_list_new): >+ (ewk_back_forward_list_free): >+ * UIProcess/API/efl/ewk_back_forward_list.h: Added. >+ * UIProcess/API/efl/ewk_back_forward_list_item.cpp: Added. >+ (getItemProperty): >+ (_Ewk_Back_Forward_List_Item): >+ (_Ewk_Back_Forward_List_Item::_Ewk_Back_Forward_List_Item): >+ (_Ewk_Back_Forward_List_Item::~_Ewk_Back_Forward_List_Item): >+ (ewk_back_forward_list_item_ref): >+ (ewk_back_forward_list_item_unref): >+ (ewk_back_forward_list_item_uri_get): >+ (ewk_back_forward_list_item_title_get): >+ (ewk_back_forward_list_item_original_uri_get): >+ (ewk_back_forward_list_item_new): >+ * UIProcess/API/efl/ewk_back_forward_list_item.h: Added. >+ * UIProcess/API/efl/ewk_back_forward_list_item_private.h: Added. >+ * UIProcess/API/efl/ewk_back_forward_list_private.h: Added. >+ * UIProcess/API/efl/ewk_view.cpp: >+ (_Ewk_View_Private_Data): >+ (_Ewk_View_Private_Data::_Ewk_View_Private_Data): >+ (_Ewk_View_Private_Data::~_Ewk_View_Private_Data): >+ (ewk_view_back_forward_list_get): New function to get back-forward list. >+ * UIProcess/API/efl/ewk_view.h: >+ * UIProcess/API/efl/ewk_view_loader_client.cpp: >+ (didChangeBackForwardList): The callback added to update back-forward list items cache. >+ (ewk_view_loader_client_attach): >+ > 2012-07-27 YoungTaeck Song <youngtaeck.song@samsung.com> > > [WK2][EFL] Add an ACCELERATED_COMPOSITING implementation for Efl WebKit2 >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index 2327af5..6a6ef35 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -41,6 +41,8 @@ LIST(APPEND WebKit2_SOURCES > UIProcess/API/efl/NetworkInfoProvider.cpp > UIProcess/API/efl/PageClientImpl.cpp > UIProcess/API/efl/VibrationProvider.cpp >+ UIProcess/API/efl/ewk_back_forward_list.cpp >+ UIProcess/API/efl/ewk_back_forward_list_item.cpp > UIProcess/API/efl/ewk_context.cpp > UIProcess/API/efl/ewk_context_request_manager_client.cpp > UIProcess/API/efl/ewk_cookie_manager.cpp >@@ -184,6 +186,8 @@ SET(ForwardingNetworkHeaders_NAME forwarding-headerSoup) > CONFIGURE_FILE(efl/ewebkit2.pc.in ${CMAKE_BINARY_DIR}/WebKit2/efl/ewebkit2.pc @ONLY) > SET (EWebKit2_HEADERS > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/EWebKit2.h" >+ "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_back_forward_list.h" >+ "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_back_forward_list_item.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_context.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_cookie_manager.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_form_submission_request.h" >diff --git a/Source/WebKit2/UIProcess/API/efl/EWebKit2.h b/Source/WebKit2/UIProcess/API/efl/EWebKit2.h >index 744fc16..379bdcd 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EWebKit2.h >+++ b/Source/WebKit2/UIProcess/API/efl/EWebKit2.h >@@ -27,6 +27,8 @@ > #ifndef EWebKit2_h > #define EWebKit2_h > >+#include "ewk_back_forward_list.h" >+#include "ewk_back_forward_list_item.h" > #include "ewk_context.h" > #include "ewk_cookie_manager.h" > #include "ewk_form_submission_request.h" >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp >new file mode 100644 >index 0000000..6f21abb >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.cpp >@@ -0,0 +1,162 @@ >+/* >+ * 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_back_forward_list.h" >+ >+#include "WKAPICast.h" >+#include "WKArray.h" >+#include "WKBackForwardList.h" >+#include "WKRetainPtr.h" >+#include "ewk_back_forward_list_item_private.h" >+#include <wtf/text/CString.h> >+ >+using namespace WebKit; >+ >+typedef HashMap<WKBackForwardListItemRef, Ewk_Back_Forward_List_Item*> ItemsMap; >+ >+/** >+ * \struct _Ewk_Back_Forward_List >+ * @brief Contains the Back Forward List data. >+ */ >+struct _Ewk_Back_Forward_List { >+ WKRetainPtr<WKBackForwardListRef> wkList; >+ mutable ItemsMap itemsCache; >+ >+ _Ewk_Back_Forward_List(WKBackForwardListRef listRef) >+ : wkList(listRef) >+ { } >+ >+ ~_Ewk_Back_Forward_List() >+ { >+ ItemsMap::iterator it = itemsCache.begin(); >+ ItemsMap::iterator end = itemsCache.begin(); >+ for (; it != end; ++it) >+ ewk_back_forward_list_item_unref(it->second); >+ >+ } >+}; >+ >+#define EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList_, ...) \ >+ if (!(list)) { \ >+ EINA_LOG_CRIT("list is NULL."); \ >+ return __VA_ARGS__; \ >+ } \ >+ if (!(list)->wkList) { \ >+ EINA_LOG_CRIT("list->wkList is NULL."); \ >+ return __VA_ARGS__; \ >+ } \ >+ WKBackForwardListRef wkList_ = (list)->wkList.get() >+ >+ >+static inline Ewk_Back_Forward_List_Item* getOrCreateItem(const Ewk_Back_Forward_List* list, WKBackForwardListItemRef wkItem) >+{ >+ EINA_SAFETY_ON_NULL_RETURN_VAL(list, 0); >+ EINA_SAFETY_ON_NULL_RETURN_VAL(wkItem, 0); >+ >+ Ewk_Back_Forward_List_Item* item = list->itemsCache.get(wkItem); >+ if (!item) { >+ item = ewk_back_forward_list_item_new(wkItem); >+ list->itemsCache.set(wkItem, item); >+ } >+ >+ return item; >+} >+ >+Ewk_Back_Forward_List_Item* ewk_back_forward_list_current_item_get(const Ewk_Back_Forward_List *list) >+{ >+ EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0); >+ >+ return getOrCreateItem(list, WKBackForwardListGetCurrentItem(wkList)); >+} >+ >+Ewk_Back_Forward_List_Item* ewk_back_forward_list_previous_item_get(const Ewk_Back_Forward_List* list) >+{ >+ EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0); >+ >+ return getOrCreateItem(list, WKBackForwardListGetBackItem(wkList)); >+} >+ >+Ewk_Back_Forward_List_Item* ewk_back_forward_list_next_item_get(const Ewk_Back_Forward_List* list) >+{ >+ EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0); >+ >+ return getOrCreateItem(list, WKBackForwardListGetForwardItem(wkList)); >+} >+ >+Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_at_index_get(const Ewk_Back_Forward_List* list, int index) >+{ >+ EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0); >+ >+ return getOrCreateItem(list, WKBackForwardListGetItemAtIndex(wkList, index)); >+} >+ >+unsigned ewk_back_forward_list_count(Ewk_Back_Forward_List* list) >+{ >+ EWK_BACK_FORWARD_LIST_WK_GET_OR_RETURN(list, wkList, 0); >+ >+ const unsigned currentItem = ewk_back_forward_list_current_item_get(list) ? 1 : 0; >+ >+ return WKBackForwardListGetBackListCount(wkList) + WKBackForwardListGetForwardListCount(wkList) + currentItem; >+} >+ >+ >+/** >+ * @internal >+ * Updates items cache. >+ */ >+void ewk_back_forward_list_changed(Ewk_Back_Forward_List* list, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems) >+{ >+ (void)getOrCreateItem(list, wkAddedItem); // Puts new item to the cache. >+ >+ const size_t removedItemsSize = wkRemovedItems ? WKArrayGetSize(wkRemovedItems) : 0; >+ for (size_t i = 0; i < removedItemsSize; ++i) { >+ WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkRemovedItems, i)); >+ if (Ewk_Back_Forward_List_Item* item = list->itemsCache.take(wkItem)) >+ ewk_back_forward_list_item_unref(item); >+ } >+} >+ >+/** >+ * @internal >+ * Constructs a Ewk_Back_Forward_List from a WKBackForwardListRef. >+ */ >+Ewk_Back_Forward_List* ewk_back_forward_list_new(WKBackForwardListRef wkBackForwardListRef) >+{ >+ EINA_SAFETY_ON_NULL_RETURN_VAL(wkBackForwardListRef, 0); >+ >+ return new Ewk_Back_Forward_List(wkBackForwardListRef); >+} >+ >+/** >+ * @internal >+ * Frees a Ewk_Back_Forward_List object. >+ */ >+void ewk_back_forward_list_free(Ewk_Back_Forward_List* list) >+{ >+ EINA_SAFETY_ON_NULL_RETURN(list); >+ >+ delete list; >+} >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h >new file mode 100644 >index 0000000..4390d13 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h >@@ -0,0 +1,92 @@ >+/* >+ * 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_back_forward_list.h >+ * @brief Describes the Ewk Back Forward List API. >+ */ >+ >+#ifndef ewk_back_forward_list_h >+#define ewk_back_forward_list_h >+ >+#include "ewk_back_forward_list_item.h" >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/** Creates a type name for _Ewk_Back_Forward_List */ >+typedef struct _Ewk_Back_Forward_List Ewk_Back_Forward_List; >+ >+/** >+ * Returns the current item in the @a list. >+ * >+ * @param list the back-forward list instance >+ * >+ * @return the current item in the @a list or @c NULL in case of error. >+ */ >+EAPI Ewk_Back_Forward_List_Item *ewk_back_forward_list_current_item_get(const Ewk_Back_Forward_List *list); >+ >+/** >+ * Returns the item that precedes the current item in the @a list. >+ * >+ * @param list the back-forward list instance >+ * >+ * @return the item that precedes the current item the @a list or @c NULL in case of error. >+ */ >+EAPI Ewk_Back_Forward_List_Item *ewk_back_forward_list_previous_item_get(const Ewk_Back_Forward_List *list); >+ >+/** >+ * Returns the item that follows the current item in the @a list. >+ * >+ * @param list the back-forward list instance >+ * >+ * @return the item that follows the current item in the @a list or @c NULL in case of error. >+ */ >+EAPI Ewk_Back_Forward_List_Item *ewk_back_forward_list_next_item_get(const Ewk_Back_Forward_List *list); >+ >+/** >+ * Returns the item at a given @a index relative to the current item. >+ * >+ * @param list the back-forward list instance >+ * @param index the index of the item >+ * >+ * @return the item at a given @a index relative to the current item or @c NULL in case of error. >+ */ >+EAPI Ewk_Back_Forward_List_Item *ewk_back_forward_list_item_at_index_get(const Ewk_Back_Forward_List *list, int index); >+ >+/** >+ * Returns the length of the back-forward list including current item. >+ * >+ * @param list the back-forward list instance >+ * >+ * @return the length of the back-forward list including current item or @c 0 in case of error. >+ */ >+EAPI unsigned ewk_back_forward_list_count(Ewk_Back_Forward_List *list); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif // ewk_back_forward_list_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp >new file mode 100644 >index 0000000..63ec343 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.cpp >@@ -0,0 +1,116 @@ >+/* >+ * 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 item of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this item 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_back_forward_list_item.h" >+ >+#include "WKAPICast.h" >+#include "WKBackForwardListItem.h" >+#include "WKRetainPtr.h" >+#include "WKString.h" >+#include "WKURL.h" >+#include <wtf/text/CString.h> >+ >+using namespace WebKit; >+ >+template <typename WKRefType> >+inline const char* getItemProperty(WKBackForwardListItemRef ref, WKRefType val) >+{ >+ ASSERT(ref); >+ WKRetainPtr<WKRefType> wkProp(AdoptWK, val); >+ return eina_stringshare_add(toImpl(wkProp.get())->string().utf8().data()); >+} >+ >+/** >+ * \struct _Ewk_Back_Forward_List >+ * @brief Contains the Back Forward List data. >+ */ >+struct _Ewk_Back_Forward_List_Item { >+ unsigned int __ref; /**< the reference count of the object */ >+ WKRetainPtr<WKBackForwardListItemRef> wkItem; >+ const char* uri; >+ const char* title; >+ const char* originalUri; >+ >+ _Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef) >+ : __ref(1) >+ , wkItem(itemRef) >+ , uri(getItemProperty<WKURLRef>(itemRef, WKBackForwardListItemCopyURL(itemRef))) >+ , title(getItemProperty<WKStringRef>(itemRef, WKBackForwardListItemCopyTitle(itemRef))) >+ , originalUri(getItemProperty<WKURLRef>(itemRef, WKBackForwardListItemCopyOriginalURL(itemRef))) >+ { } >+ >+ ~_Ewk_Back_Forward_List_Item() >+ { >+ ASSERT(!__ref); >+ eina_stringshare_del(uri); >+ eina_stringshare_del(title); >+ eina_stringshare_del(originalUri); >+ } >+}; >+ >+void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item* item) >+{ >+ EINA_SAFETY_ON_NULL_RETURN(item); >+ ++item->__ref; >+} >+ >+void ewk_back_forward_list_item_unref(Ewk_Back_Forward_List_Item* item) >+{ >+ EINA_SAFETY_ON_NULL_RETURN(item); >+ >+ if (--item->__ref) >+ return; >+ >+ delete item; >+} >+ >+const char* ewk_back_forward_list_item_uri_get(const Ewk_Back_Forward_List_Item* item) >+{ >+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); >+ >+ return item->uri; >+} >+ >+const char* ewk_back_forward_list_item_title_get(const Ewk_Back_Forward_List_Item* item) >+{ >+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); >+ >+ return item->title; >+} >+ >+const char* ewk_back_forward_list_item_original_uri_get(const Ewk_Back_Forward_List_Item* item) >+{ >+ EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); >+ >+ return item->originalUri; >+} >+ >+Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_new(WKBackForwardListItemRef backForwardListItemData) >+{ >+ EINA_SAFETY_ON_NULL_RETURN_VAL(backForwardListItemData, 0); >+ >+ return new Ewk_Back_Forward_List_Item(backForwardListItemData); >+} >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h >new file mode 100644 >index 0000000..7be0657 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h >@@ -0,0 +1,106 @@ >+/* >+ * 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_back_forward_list_item.h >+ * @brief Describes the Ewk Back Forward List Item API. >+ */ >+ >+#ifndef ewk_back_forward_list_item_h >+#define ewk_back_forward_list_item_h >+ >+#include <Eina.h> >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/** Creates a type name for _Ewk_Back_Forward_List_Item */ >+typedef struct _Ewk_Back_Forward_List_Item Ewk_Back_Forward_List_Item; >+ >+/** >+ * Increases the reference count of the given object. >+ * >+ * @param item the back-forward list item instance to increase the reference count >+ */ >+EAPI void ewk_back_forward_list_item_ref(Ewk_Back_Forward_List_Item *item); >+ >+/** >+ * Decreases the reference count of the given object, possibly freeing it. >+ * >+ * When the reference count reaches 0, the item is freed. >+ * >+ * @param item the back-forward list item instance to decrease the reference count >+ */ >+EAPI void ewk_back_forward_list_item_unref(Ewk_Back_Forward_List_Item *item); >+ >+/** >+ * Returns URI of the item. >+ * >+ * The returned URI may differ from the original URI (For example if the page was redirected). >+ * @see ewk_back_forward_list_item_original_uri_get(). >+ * >+ * @param item the back-forward list item instance >+ * >+ * @return the URI of the @a item or @c NULL in case of error. 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_back_forward_list_item_uri_get(const Ewk_Back_Forward_List_Item *item); >+ >+/** >+ * Returns title of the item. >+ * >+ * @param item the back-forward list item instance >+ * >+ * @return the title of the @a item or @c NULL in case of error. 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_back_forward_list_item_title_get(const Ewk_Back_Forward_List_Item *item); >+ >+/** >+ * Returns original URI of the item. >+ * >+ * @see ewk_back_forward_list_item_uri_get(). >+ * >+ * @param item the back-forward list item instance >+ * >+ * @return the original URI of the @a item or @c NULL in case of error. 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_back_forward_list_item_original_uri_get(const Ewk_Back_Forward_List_Item *item); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif // ewk_back_forward_list_item_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h >new file mode 100644 >index 0000000..8c2c684 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h >@@ -0,0 +1,35 @@ >+/* >+ * 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 item of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this item 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_back_forward_list_item_private_h >+#define ewk_back_forward_list_item_private_h >+ >+#include <WebKit2/WKBase.h> >+ >+typedef struct _Ewk_Back_Forward_List_Item Ewk_Back_Forward_List_Item; >+ >+Ewk_Back_Forward_List_Item* ewk_back_forward_list_item_new(WKBackForwardListItemRef wkBackForwardListItemRef); >+ >+#endif // ewk_back_forward_list_private_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h >new file mode 100644 >index 0000000..592a4f4 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h >@@ -0,0 +1,37 @@ >+/* >+ * 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_back_forward_list_private_h >+#define ewk_back_forward_list_private_h >+ >+#include <WebKit2/WKBase.h> >+ >+typedef struct _Ewk_Back_Forward_List Ewk_Back_Forward_List; >+ >+void ewk_back_forward_list_changed(Ewk_Back_Forward_List*, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems); >+Ewk_Back_Forward_List* ewk_back_forward_list_new(WKBackForwardListRef wkBackForwardListRef); >+void ewk_back_forward_list_free(Ewk_Back_Forward_List* list); >+ >+#endif // ewk_back_forward_list_private_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp >index 27d40c1..2e0f398 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp >@@ -29,6 +29,7 @@ > #include "WKRetainPtr.h" > #include "WKString.h" > #include "WKURL.h" >+#include "ewk_back_forward_list_private.h" > #include "ewk_context.h" > #include "ewk_context_private.h" > #include "ewk_intent_private.h" >@@ -67,6 +68,7 @@ struct _Ewk_View_Private_Data { > const char* cursorGroup; > Evas_Object* cursorObject; > LoadingResourcesMap loadingResourcesMap; >+ Ewk_Back_Forward_List* backForwardList; > > #ifdef HAVE_ECORE_X > bool isUsingEcoreX; >@@ -85,6 +87,7 @@ struct _Ewk_View_Private_Data { > , customEncoding(0) > , cursorGroup(0) > , cursorObject(0) >+ , backForwardList(0) > #ifdef HAVE_ECORE_X > , isUsingEcoreX(false) > #endif >@@ -105,6 +108,8 @@ struct _Ewk_View_Private_Data { > > if (cursorObject) > evas_object_del(cursorObject); >+ >+ ewk_back_forward_list_free(backForwardList); > } > }; > >@@ -661,6 +666,7 @@ Evas_Object* ewk_view_base_add(Evas* canvas, WKContextRef contextRef, WKPageGrou > } > > priv->pageClient = PageClientImpl::create(toImpl(contextRef), toImpl(pageGroupRef), ewkView); >+ priv->backForwardList = ewk_back_forward_list_new(toAPI(priv->pageClient->page()->backForwardList())); > > WKPageRef wkPage = toAPI(priv->pageClient->page()); > ewk_view_form_client_attach(wkPage, ewkView); >@@ -1066,6 +1072,14 @@ Eina_Bool ewk_view_forward_possible(Evas_Object* ewkView) > return priv->pageClient->page()->canGoForward(); > } > >+Ewk_Back_Forward_List* ewk_view_back_forward_list_get(const Evas_Object* ewkView) >+{ >+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); >+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); >+ >+ return priv->backForwardList; >+} >+ > void ewk_view_image_data_set(Evas_Object* ewkView, void* imageData, const IntSize& size) > { > EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h >index a18ea78..268c186 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h >@@ -61,6 +61,7 @@ > #ifndef ewk_view_h > #define ewk_view_h > >+#include "ewk_back_forward_list.h" > #include "ewk_context.h" > #include "ewk_intent.h" > #include "ewk_url_request.h" >@@ -319,6 +320,22 @@ EAPI Eina_Bool ewk_view_back_possible(Evas_Object *o); > EAPI Eina_Bool ewk_view_forward_possible(Evas_Object *o); > > /** >+ * Gets the back-forward list associated with this view. >+ * >+ * The returned instance is unique for this view and thus multiple calls >+ * to this function with the same view as parameter returns the same >+ * handle. This handle is alive while view is alive, thus one >+ * might want to listen for EVAS_CALLBACK_DEL on given view >+ * (@a o) to know when to stop using returned handle. >+ * >+ * @param o view object to get navigation back-forward list >+ * >+ * @return the back-forward list instance handle associated with this >+ * view. >+ */ >+EAPI Ewk_Back_Forward_List *ewk_view_back_forward_list_get(const Evas_Object *o); >+ >+/** > * Gets the current title of the main frame. > * > * It returns an internal string and should not >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp >index cc8b120..e77d613 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp >@@ -26,10 +26,12 @@ > #include "config.h" > > #include "WKFrame.h" >+#include "ewk_back_forward_list_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.h" > #include "ewk_view_loader_client_private.h" > #include "ewk_view_private.h" > #include "ewk_web_error.h" >@@ -123,6 +125,14 @@ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef f > ewk_web_error_free(ewkError); > } > >+static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo) >+{ >+ Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo)); >+ ASSERT(ewkView); >+ >+ ewk_back_forward_list_changed(ewk_view_back_forward_list_get(ewkView), addedItem, removedItems); >+} >+ > void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView) > { > WKPageLoaderClient loadClient; >@@ -144,5 +154,6 @@ void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView) > loadClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame; > loadClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame; > loadClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame; >+ loadClient.didChangeBackForwardList = didChangeBackForwardList; > WKPageSetPageLoaderClient(pageRef, &loadClient); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 92345
:
154905
|
154928
|
154948
|
155223
|
156375
|
156617
|
156654
|
156900