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

Unified Diff: content/browser/frame_host/navigation_controller_impl.h

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
Index: content/browser/frame_host/navigation_controller_impl.h
diff --git a/content/browser/frame_host/navigation_controller_impl.h b/content/browser/frame_host/navigation_controller_impl.h
index c7df11d36fa8b403ade443fcfea012aeda3a204b..e12516f7e110faac820873f28aa455b73a44afb8 100644
--- a/content/browser/frame_host/navigation_controller_impl.h
+++ b/content/browser/frame_host/navigation_controller_impl.h
@@ -20,6 +20,7 @@
struct FrameHostMsg_DidCommitProvisionalLoad_Params;
namespace content {
+class FrameTreeNode;
class RenderFrameHostImpl;
class NavigationEntryScreenshotManager;
class SiteInstance;
@@ -102,16 +103,17 @@ class CONTENT_EXPORT NavigationControllerImpl
// in this NavigationController.
int GetIndexOfEntry(const NavigationEntryImpl* entry) const;
- // Return the index of the entry with the corresponding instance and page_id,
- // or -1 if not found.
- int GetEntryIndexWithPageID(SiteInstance* instance,
- int32 page_id) const;
+ // Return the index of the entry with the corresponding page_id, or -1 if not
+ // found.
+ int GetEntryIndexWithPageID(int32 page_id) const;
- // Return the entry with the corresponding instance and page_id, or NULL if
- // not found.
- NavigationEntryImpl* GetEntryWithPageID(
- SiteInstance* instance,
- int32 page_id) const;
+ // TODO(creis): Private? const?
+ int GetFrameEntryIndex(int64 frame_tree_node_id,
+ SiteInstance* site_instance,
+ int64 item_sequence_number);
+
+ // Return the entry with the corresponding page_id, or NULL if not found.
+ NavigationEntryImpl* GetEntryWithPageID(int32 page_id) const;
NavigationControllerDelegate* delegate() const {
return delegate_;
@@ -212,6 +214,9 @@ class CONTENT_EXPORT NavigationControllerImpl
FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates);
FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump);
+ typedef std::vector<std::pair<FrameTreeNode*, FrameNavigationEntry*> >
+ FrameLoadVector;
+
// Helper class to smooth out runs of duplicate timestamps while still
// allowing time to jump backwards.
class CONTENT_EXPORT TimeSmoother {
@@ -226,6 +231,16 @@ class CONTENT_EXPORT NavigationControllerImpl
base::Time high_water_mark_;
};
+ // TODO(creis): Remove and share code with CreateNavigationEntry.
+ NavigationEntryImpl* CreateSubframeNavigationEntry(
+ int64 frame_tree_node_id,
+ const GURL& url,
+ const Referrer& referrer,
+ ui::PageTransition transition,
+ bool is_renderer_initiated,
+ const std::string& extra_headers,
+ BrowserContext* browser_context);
+
// Classifies the given renderer navigation (see the NavigationType enum).
NavigationType ClassifyNavigation(
RenderFrameHostImpl* rfh,
@@ -291,7 +306,10 @@ class CONTENT_EXPORT NavigationControllerImpl
// Inserts a new entry or replaces the current entry with a new one, removing
// all entries after it. The new entry will become the active one.
- void InsertOrReplaceEntry(NavigationEntryImpl* entry, bool replace);
+ void InsertOrReplaceEntry(RenderFrameHostImpl* render_frame_host,
+ NavigationEntryImpl* entry,
+ FrameNavigationEntry* frame_entry,
+ bool replace);
// Removes the entry at |index|, as long as it is not the current entry.
void RemoveEntryAtIndexInternal(int index);
@@ -327,6 +345,19 @@ class CONTENT_EXPORT NavigationControllerImpl
// specified |offset|. The index returned is not guaranteed to be valid.
int GetIndexForOffset(int offset) const;
+ // Recursively add FrameNavigationEntry pointers for the current entries in
+ // each frame's session history to the tree in the top-level NavigationEntry.
+ void AddFramesToNavigationEntry(
+ NavigationEntryImpl::TreeNode* entry_node,
+ FrameTreeNode* frame_tree_node);
+
+ // Recursively identifies which frames need to be navigated for the pending
+ // NavigationEntry, then tells each such frame to navigate.
+ bool NavigateToPendingEntryInternal(ReloadType reload_type);
+ void RecursiveNavigateToPendingEntry(FrameTreeNode* frame,
+ FrameLoadVector* sameDocumentLoads,
+ FrameLoadVector* differentDocumentLoads);
+
// ---------------------------------------------------------------------------
// The user browser context associated with this controller.
@@ -363,6 +394,10 @@ class CONTENT_EXPORT NavigationControllerImpl
// setup.
NavigationControllerDelegate* delegate_;
+ // The next available page ID, which identifies joint session history items.
+ // TODO(creis): Copy when cloning tabs.
+ int32 next_page_id_;
+
// The max restored page ID in this controller, if it was restored. We must
// store this so that WebContentsImpl can tell any renderer in charge of one
// of the restored entries to update its max page ID.
« no previous file with comments | « content/browser/frame_host/navigation_controller_delegate.h ('k') | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698