Changeset 44903 in webkit
- Timestamp:
- Jun 20, 2009 2:56:54 PM (15 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r44898 r44903 1 2009-06-20 Jan Michael Alonzo <jmalonzo@webkit.org> 2 3 Reviewed by Gustavo Noronha and Xan Lopez. 4 5 webkit_web_back_forward_list_add_item() should add a ref for the history item 6 https://bugs.webkit.org/show_bug.cgi?id=26517 7 8 Add a ref to the WebHistoryItem when it's added to the back 9 forward list through webkit_web_back_forward_list_add_item. 10 This keeps the history item alive and prevents pywebkitgtk from 11 crashing 12 13 * tests/testwebbackforwardlist.c: 14 (test_webkit_web_history_item_lifetime): 15 (test_webkit_web_back_forward_list_order): 16 (test_webkit_web_back_forward_list_add_item): 17 * webkit/webkitwebbackforwardlist.cpp: 18 (webkit_web_back_forward_list_add_item): 19 1 20 2009-06-20 Gustavo Noronha Silva <gns@gnome.org> 2 21 -
trunk/WebKit/gtk/tests/testwebbackforwardlist.c
r44228 r44903 48 48 item1 = webkit_web_history_item_new_with_data("http://example.com/1/", "Site 1"); 49 49 webkit_web_back_forward_list_add_item(backForwardList, item1); 50 g_object_unref(item1); 50 51 51 52 item2 = webkit_web_history_item_new_with_data("http://example.com/2/", "Site 2"); 52 53 webkit_web_back_forward_list_add_item(backForwardList, item2); 54 g_object_unref(item2); 53 55 54 56 item3 = webkit_web_history_item_new_with_data("http://example.com/3/", "Site 3"); 55 57 webkit_web_back_forward_list_add_item(backForwardList, item3); 58 g_object_unref(item3); 56 59 57 60 item4 = webkit_web_history_item_new_with_data("http://example.com/4/", "Site 4"); 58 61 webkit_web_back_forward_list_add_item(backForwardList, item4); 62 g_object_unref(item4); 59 63 60 64 /* make sure these functions don't add unnecessary ref to the history item */ … … 132 136 item1 = webkit_web_history_item_new_with_data("http://example.com/1/", "Site 1"); 133 137 webkit_web_back_forward_list_add_item(webBackForwardList, item1); 138 g_object_unref(item1); 134 139 g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item1)); 135 140 136 141 item2 = webkit_web_history_item_new_with_data("http://example.com/2/", "Site 2"); 137 142 webkit_web_back_forward_list_add_item(webBackForwardList, item2); 143 g_object_unref(item2); 138 144 g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item2)); 139 145 140 146 item3 = webkit_web_history_item_new_with_data("http://example.com/3/", "Site 3"); 141 147 webkit_web_back_forward_list_add_item(webBackForwardList, item3); 148 g_object_unref(item3); 142 149 g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item3)); 143 150 144 151 item4 = webkit_web_history_item_new_with_data("http://example.com/4/", "Site 4"); 145 152 webkit_web_back_forward_list_add_item(webBackForwardList, item4); 153 g_object_unref(item4); 146 154 g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, item4)); 147 155 … … 215 223 addItem1 = webkit_web_history_item_new_with_data("http://example.com/", "Added site"); 216 224 webkit_web_back_forward_list_add_item(webBackForwardList, addItem1); 225 g_object_unref(addItem1); 217 226 g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, addItem1)); 218 227 … … 230 239 addItem2 = webkit_web_history_item_new_with_data("http://example.com/2/", "Added site 2"); 231 240 webkit_web_back_forward_list_add_item(webBackForwardList, addItem2); 241 g_object_unref(addItem2); 232 242 g_assert(webkit_web_back_forward_list_contains_item(webBackForwardList, addItem2)); 233 243 -
trunk/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
r44228 r44903 420 420 * Adds the item to the #WebKitWebBackForwardList. 421 421 * 422 * The @webBackForwardList will steal the reference of the 423 * @webHistoryItem, so you don't need to unref it after adding it to 424 * the list. 422 * The @webBackForwardList will add a reference to the @webHistoryItem, so you 423 * don't need to keep a reference once you've added it to the list. 425 424 * 426 425 * Since: 1.1.1 … … 430 429 g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); 431 430 431 g_object_ref(webHistoryItem); 432 432 433 WebCore::BackForwardList* backForwardList = core(webBackForwardList); 433 434 WebCore::HistoryItem* historyItem = core(webHistoryItem);
Note: See TracChangeset
for help on using the changeset viewer.