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

Unified Diff: content/renderer/history_controller.cc

Issue 281653003: DRAFT CL: Add FrameNavigationEntry and track subframe session histories. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/history_controller.h ('k') | content/renderer/history_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/history_controller.cc
diff --git a/content/renderer/history_controller.cc b/content/renderer/history_controller.cc
index d6f1abdf5e378a12fc29cb8c1ff5cf65e4009db9..44454ab33fd3c0514fb7c8e0fa450171f71d5f7e 100644
--- a/content/renderer/history_controller.cc
+++ b/content/renderer/history_controller.cc
@@ -53,79 +53,6 @@ HistoryController::HistoryController(RenderViewImpl* render_view)
HistoryController::~HistoryController() {
}
-void HistoryController::GoToEntry(scoped_ptr<HistoryEntry> target_entry,
- WebURLRequest::CachePolicy cache_policy) {
- HistoryFrameLoadVector same_document_loads;
- HistoryFrameLoadVector different_document_loads;
-
- provisional_entry_ = target_entry.Pass();
-
- WebFrame* main_frame = render_view_->GetMainRenderFrame()->GetWebFrame();
- if (current_entry_) {
- RecursiveGoToEntry(
- main_frame, same_document_loads, different_document_loads);
- }
-
- if (same_document_loads.empty() && different_document_loads.empty()) {
- // If we don't have any frames to navigate at this point, either
- // (1) there is no previous history entry to compare against, or
- // (2) we were unable to match any frames by name. In the first case,
- // doing a different document navigation to the root item is the only valid
- // thing to do. In the second case, we should have been able to find a
- // frame to navigate based on names if this were a same document
- // navigation, so we can safely assume this is the different document case.
- different_document_loads.push_back(
- std::make_pair(main_frame, provisional_entry_->root()));
- }
-
- for (size_t i = 0; i < same_document_loads.size(); ++i) {
- WebFrame* frame = same_document_loads[i].first;
- if (!RenderFrameImpl::FromWebFrame(frame))
- continue;
- frame->loadHistoryItem(same_document_loads[i].second,
- blink::WebHistorySameDocumentLoad,
- cache_policy);
- }
- for (size_t i = 0; i < different_document_loads.size(); ++i) {
- WebFrame* frame = different_document_loads[i].first;
- if (!RenderFrameImpl::FromWebFrame(frame))
- continue;
- frame->loadHistoryItem(different_document_loads[i].second,
- blink::WebHistoryDifferentDocumentLoad,
- cache_policy);
- }
-}
-
-void HistoryController::RecursiveGoToEntry(
- WebFrame* frame,
- HistoryFrameLoadVector& same_document_loads,
- HistoryFrameLoadVector& different_document_loads) {
- DCHECK(provisional_entry_);
- DCHECK(current_entry_);
- RenderFrameImpl* render_frame = RenderFrameImpl::FromWebFrame(frame);
- const WebHistoryItem& new_item =
- provisional_entry_->GetItemForFrame(render_frame);
- const WebHistoryItem& old_item =
- current_entry_->GetItemForFrame(render_frame);
- if (new_item.isNull())
- return;
-
- if (old_item.isNull() ||
- new_item.itemSequenceNumber() != old_item.itemSequenceNumber()) {
- if (!old_item.isNull() &&
- new_item.documentSequenceNumber() == old_item.documentSequenceNumber())
- same_document_loads.push_back(std::make_pair(frame, new_item));
- else
- different_document_loads.push_back(std::make_pair(frame, new_item));
- return;
- }
-
- for (WebFrame* child = frame->firstChild(); child;
- child = child->nextSibling()) {
- RecursiveGoToEntry(child, same_document_loads, different_document_loads);
- }
-}
-
void HistoryController::UpdateForInitialLoadInChildFrame(
RenderFrameImpl* frame,
const WebHistoryItem& item) {
« no previous file with comments | « content/renderer/history_controller.h ('k') | content/renderer/history_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698