| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } | 877 } |
| 878 | 878 |
| 879 m_frame->loader()->load(resourceRequest, false); | 879 m_frame->loader()->load(resourceRequest, false); |
| 880 } | 880 } |
| 881 | 881 |
| 882 void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item) | 882 void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item) |
| 883 { | 883 { |
| 884 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item); | 884 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item); |
| 885 ASSERT(historyItem.get()); | 885 ASSERT(historyItem.get()); |
| 886 | 886 |
| 887 // Sanity check for http://webkit.org/b/52819. It appears that some child | |
| 888 // items of this item might be null. Try validating just the first set of | |
| 889 // children in an attempt to catch it early. | |
| 890 const HistoryItemVector& childItems = historyItem->children(); | |
| 891 int size = childItems.size(); | |
| 892 for (int i = 0; i < size; ++i) { | |
| 893 RefPtr<HistoryItem> childItem = childItems[i].get(); | |
| 894 if (!childItem.get()) | |
| 895 CRASH(); | |
| 896 } | |
| 897 | |
| 898 // If there is no currentItem, which happens when we are navigating in | 887 // If there is no currentItem, which happens when we are navigating in |
| 899 // session history after a crash, we need to manufacture one otherwise WebKi
t | 888 // session history after a crash, we need to manufacture one otherwise WebKi
t |
| 900 // hoarks. This is probably the wrong thing to do, but it seems to work. | 889 // hoarks. This is probably the wrong thing to do, but it seems to work. |
| 901 RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem(
); | 890 RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem(
); |
| 902 if (!currentItem) { | 891 if (!currentItem) { |
| 903 currentItem = HistoryItem::create(); | 892 currentItem = HistoryItem::create(); |
| 904 currentItem->setLastVisitWasFailure(true); | 893 currentItem->setLastVisitWasFailure(true); |
| 905 m_frame->loader()->history()->setCurrentItem(currentItem.get()); | 894 m_frame->loader()->history()->setCurrentItem(currentItem.get()); |
| 906 m_frame->page()->backForward()->setCurrentItem(currentItem.get()); | 895 m_frame->page()->backForward()->setCurrentItem(currentItem.get()); |
| 907 } | 896 } |
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 | 2284 |
| 2296 String scriptResult; | 2285 String scriptResult; |
| 2297 if (!result.getString(scriptResult)) | 2286 if (!result.getString(scriptResult)) |
| 2298 return; | 2287 return; |
| 2299 | 2288 |
| 2300 if (!m_frame->navigationScheduler()->locationChangePending()) | 2289 if (!m_frame->navigationScheduler()->locationChangePending()) |
| 2301 m_frame->loader()->writer()->replaceDocument(scriptResult); | 2290 m_frame->loader()->writer()->replaceDocument(scriptResult); |
| 2302 } | 2291 } |
| 2303 | 2292 |
| 2304 } // namespace WebKit | 2293 } // namespace WebKit |
| OLD | NEW |