Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: Source/WebKit/chromium/src/WebFrameImpl.cpp

Issue 7711011: Merge 93296 - Prepare frames for history navigation. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 } 854 }
855 855
856 m_frame->loader()->load(resourceRequest, false); 856 m_frame->loader()->load(resourceRequest, false);
857 } 857 }
858 858
859 void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item) 859 void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
860 { 860 {
861 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item); 861 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item);
862 ASSERT(historyItem.get()); 862 ASSERT(historyItem.get());
863 863
864 // If there is no currentItem, which happens when we are navigating in 864 m_frame->loader()->prepareForHistoryNavigation();
865 // session history after a crash, we need to manufacture one otherwise WebKi t
866 // hoarks. This is probably the wrong thing to do, but it seems to work.
867 RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem( ); 865 RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem( );
868 if (!currentItem) {
869 currentItem = HistoryItem::create();
870 currentItem->setLastVisitWasFailure(true);
871 m_frame->loader()->history()->setCurrentItem(currentItem.get());
872 m_frame->page()->backForward()->setCurrentItem(currentItem.get());
873 }
874
875 m_inSameDocumentHistoryLoad = currentItem->shouldDoSameDocumentNavigationTo( historyItem.get()); 866 m_inSameDocumentHistoryLoad = currentItem->shouldDoSameDocumentNavigationTo( historyItem.get());
876 m_frame->page()->goToItem(historyItem.get(), 867 m_frame->page()->goToItem(historyItem.get(),
877 FrameLoadTypeIndexedBackForward); 868 FrameLoadTypeIndexedBackForward);
878 m_inSameDocumentHistoryLoad = false; 869 m_inSameDocumentHistoryLoad = false;
879 } 870 }
880 871
881 void WebFrameImpl::loadData(const WebData& data, 872 void WebFrameImpl::loadData(const WebData& data,
882 const WebString& mimeType, 873 const WebString& mimeType,
883 const WebString& textEncoding, 874 const WebString& textEncoding,
884 const WebURL& baseURL, 875 const WebURL& baseURL,
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 2267
2277 String scriptResult; 2268 String scriptResult;
2278 if (!result.getString(scriptResult)) 2269 if (!result.getString(scriptResult))
2279 return; 2270 return;
2280 2271
2281 if (!m_frame->navigationScheduler()->locationChangePending()) 2272 if (!m_frame->navigationScheduler()->locationChangePending())
2282 m_frame->document()->loader()->writer()->replaceDocument(scriptResult); 2273 m_frame->document()->loader()->writer()->replaceDocument(scriptResult);
2283 } 2274 }
2284 2275
2285 } // namespace WebKit 2276 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698