summaryrefslogtreecommitdiffstats
path: root/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebKit/gtk/webkit/webkitwebbackforwardlist.cpp')
-rw-r--r--WebKit/gtk/webkit/webkitwebbackforwardlist.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index 31631a5..b23aeb9 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -252,7 +252,7 @@ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwar
/**
* webkit_web_back_forward_list_get_back_item:
- * @web_back_forward_list: a #WebBackForwardList
+ * @web_back_forward_list: a #WebKitWebBackForwardList
*
* Returns the item that precedes the current item
*
@@ -383,7 +383,7 @@ gint webkit_web_back_forward_list_get_forward_length(WebKitWebBackForwardList* w
*
* Returns the maximum limit of the back forward list.
*
- * Return value: a #gint indicating the number of #WebHistoryItem the back forward list can hold
+ * Return value: a #gint indicating the number of #WebKitWebHistoryItem the back forward list can hold
*/
gint webkit_web_back_forward_list_get_limit(WebKitWebBackForwardList* webBackForwardList)
{
@@ -438,6 +438,29 @@ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForw
backForwardList->addItem(historyItem);
}
+/**
+ * webkit_web_back_forward_list_clear:
+ * @webBackForwardList: a #WebKitWebBackForwardList
+ *
+ * Clears the @webBackForwardList by removing all its elements. Note that not even
+ * the current page is kept in list when cleared so you would have to add it later.
+ *
+ * Since: 1.1.30
+ **/
+void webkit_web_back_forward_list_clear(WebKitWebBackForwardList* webBackForwardList)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
+
+ WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ if (!backForwardList || !backForwardList->enabled() || !backForwardList->entries().size())
+ return;
+
+ // Clear the current list by setting capacity to 0
+ int capacity = backForwardList->capacity();
+ backForwardList->setCapacity(0);
+ backForwardList->setCapacity(capacity);
+}
+
WebCore::BackForwardList* WebKit::core(WebKitWebBackForwardList* webBackForwardList)
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);