Changeset 41339 in webkit
- Timestamp:
- Mar 1, 2009 11:21:34 AM (15 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r41337 r41339 1 2009-03-01 Jan Michael Alonzo <jmalonzo@webkit.org> 2 3 Reviewed by Holger Freyther. 4 5 [Gtk] get the HTTP layout tests going 6 https://bugs.webkit.org/show_bug.cgi?id=24259 7 8 Create a WebKitWebHistoryItem for each WebCore::HistoryItem when 9 necessary. 10 Add necessary API additions for us to be able to dump a WebKitWebHistoryItem 11 12 * webkit/webkitprivate.h: 13 * webkit/webkitwebbackforwardlist.cpp: 14 (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_forward_list_with_limit): 15 (_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_get_back_list_with_limit): 16 * webkit/webkitwebhistoryitem.cpp: 17 (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_core_item): 18 (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new): 19 (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_data): 20 (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_target): 21 (_WebKitWebHistoryItemPrivate::webkit_web_history_item_is_target_item): 22 (_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_children): 23 (WebKit::core): 24 (WebKit::kit): 25 1 26 2009-03-01 Christian Dywan <christian@twotoasts.de> 2 27 -
trunk/WebKit/gtk/webkit/webkitprivate.h
r41337 r41339 58 58 59 59 WebCore::HistoryItem* core(WebKitWebHistoryItem*); 60 WebKitWebHistoryItem* kit( WebCore::HistoryItem*);60 WebKitWebHistoryItem* kit(PassRefPtr<WebCore::HistoryItem>); 61 61 62 62 WebCore::BackForwardList* core(WebKitWebBackForwardList*); … … 125 125 webkit_web_frame_core_frame_gone(WebKitWebFrame*); 126 126 127 // WebKitWebHistoryItem private 127 128 WebKitWebHistoryItem* 128 webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*); 129 webkit_web_history_item_new_with_core_item(PassRefPtr<WebCore::HistoryItem> historyItem); 130 131 WEBKIT_API G_CONST_RETURN gchar* 132 webkit_web_history_item_get_target(WebKitWebHistoryItem*); 133 134 WEBKIT_API gboolean 135 webkit_web_history_item_is_target_item(WebKitWebHistoryItem*); 136 137 WEBKIT_API GList* 138 webkit_web_history_item_get_children(WebKitWebHistoryItem*); 139 // end WebKitWebHistoryItem private 129 140 130 141 void -
trunk/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
r41137 r41339 190 190 191 191 for (unsigned i = 0; i < items.size(); i++) { 192 WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new_with_core_item(items[i] .get());192 WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new_with_core_item(items[i]); 193 193 forwardItems = g_list_prepend(forwardItems, g_object_ref(webHistoryItem)); 194 194 } … … 220 220 221 221 for (unsigned i = 0; i < items.size(); i++) { 222 WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new_with_core_item(items[i] .get());222 WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new_with_core_item(items[i]); 223 223 backItems = g_list_prepend(backItems, g_object_ref(webHistoryItem)); 224 224 } -
trunk/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
r39532 r41339 1 1 /* 2 * Copyright (C) 2008 Jan Michael C. Alonzo2 * Copyright (C) 2008, 2009 Jan Michael C. Alonzo 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 54 54 55 55 struct _WebKitWebHistoryItemPrivate { 56 W TF::RefPtr<WebCore::HistoryItem>historyItem;56 WebCore::HistoryItem* historyItem; 57 57 58 58 WebCore::CString title; … … 271 271 272 272 /* Helper function to create a new WebHistoryItem instance when needed */ 273 WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(WebCore::HistoryItem* item) 274 { 275 WebKitWebHistoryItem* webHistoryItem = kit(item); 276 277 if (webHistoryItem) 278 g_object_ref(webHistoryItem); 279 else { 280 webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL)); 281 WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv; 282 283 priv->historyItem = item; 284 webkit_history_item_add(webHistoryItem, priv->historyItem.get()); 285 } 286 287 return webHistoryItem; 273 WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(PassRefPtr<WebCore::HistoryItem> historyItem) 274 { 275 return kit(historyItem); 288 276 } 289 277 … … 301 289 WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv; 302 290 303 priv->historyItem = WebCore::HistoryItem::create(); 304 webkit_history_item_add(webHistoryItem, priv->historyItem.get()); 291 RefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(); 292 priv->historyItem = item.release().releaseRef(); 293 webkit_history_item_add(webHistoryItem, priv->historyItem); 305 294 306 295 return webHistoryItem; … … 324 313 WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv; 325 314 326 priv->historyItem = WebCore::HistoryItem::create(historyUri, historyTitle, 0); 327 webkit_history_item_add(webHistoryItem, priv->historyItem.get()); 315 RefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(historyUri, historyTitle, 0); 316 priv->historyItem = item.release().releaseRef(); 317 webkit_history_item_add(webHistoryItem, priv->historyItem); 328 318 329 319 return webHistoryItem; … … 453 443 } 454 444 445 /* private methods */ 446 447 G_CONST_RETURN gchar* webkit_web_history_item_get_target(WebKitWebHistoryItem* webHistoryItem) 448 { 449 g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), NULL); 450 451 WebCore::HistoryItem* item = core(webHistoryItem); 452 453 g_return_val_if_fail(item != NULL, NULL); 454 455 WebCore::CString t = item->target().utf8(); 456 return g_strdup(t.data()); 457 } 458 459 gboolean webkit_web_history_item_is_target_item(WebKitWebHistoryItem* webHistoryItem) 460 { 461 g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), NULL); 462 463 WebCore::HistoryItem* item = core(webHistoryItem); 464 465 g_return_val_if_fail(item != NULL, NULL); 466 467 return item->isTargetItem(); 468 } 469 470 GList* webkit_web_history_item_get_children(WebKitWebHistoryItem* webHistoryItem) 471 { 472 g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), NULL); 473 474 WebCore::HistoryItem* item = core(webHistoryItem); 475 476 g_return_val_if_fail(item != NULL, NULL); 477 478 const WebCore::HistoryItemVector& children = item->children(); 479 if (!children.size()) 480 return NULL; 481 482 unsigned size = children.size(); 483 GList* kids = NULL; 484 for (unsigned i = 0; i < size; ++i) 485 kids = g_list_prepend(kids, kit(children[i].get())); 486 487 return g_list_reverse(kids); 488 } 489 455 490 } /* end extern "C" */ 456 491 … … 460 495 461 496 WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv; 462 WTF::RefPtr<WebCore::HistoryItem> historyItem = priv->historyItem; 463 464 return historyItem ? historyItem.get() : 0; 465 } 466 467 WebKitWebHistoryItem* WebKit::kit(WebCore::HistoryItem* historyItem) 497 498 return priv->historyItem ? priv->historyItem : 0; 499 } 500 501 WebKitWebHistoryItem* WebKit::kit(PassRefPtr<WebCore::HistoryItem> historyItem) 468 502 { 469 503 g_return_val_if_fail(historyItem != NULL, NULL); 504 505 RefPtr<WebCore::HistoryItem> item = historyItem; 470 506 471 507 WebKitWebHistoryItem* webHistoryItem; 472 508 GHashTable* table = webkit_history_items(); 473 509 474 webHistoryItem = (WebKitWebHistoryItem*) g_hash_table_lookup(table, historyItem); 510 webHistoryItem = (WebKitWebHistoryItem*) g_hash_table_lookup(table, item.get()); 511 512 if (!webHistoryItem) { 513 webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL)); 514 WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv; 515 516 priv->historyItem = item.release().releaseRef(); 517 webkit_history_item_add(webHistoryItem, priv->historyItem); 518 } 519 475 520 return webHistoryItem; 476 521 }
Note: See TracChangeset
for help on using the changeset viewer.