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

Unified Diff: content/public/browser/navigation_controller.h

Issue 15041004: Replace PruneAllButActive with PruneAllButVisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update tests, mark TODOs Created 7 years, 7 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/public/browser/navigation_controller.h
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h
index 51093018a9ba54315560abc330ed74e3bc64f771..ed8195f81858f8720af6d86103aefef5151ce2fb 100644
--- a/content/public/browser/navigation_controller.h
+++ b/content/public/browser/navigation_controller.h
@@ -386,18 +386,27 @@ class NavigationController {
virtual void CopyStateFrom(const NavigationController& source) = 0;
// A variant of CopyStateFrom. Removes all entries from this except the last
- // entry, inserts all entries from |source| before and including the active
- // entry. This method is intended for use when the last entry of |this| is the
- // active entry. For example:
+ // entry, and inserts all entries from |source| before and including its last
+ // committed entry. This method is intended for use when the last entry of
+ // |this| is the active entry. For example:
// source: A B *C* D
- // this: E F *G* (last must be active or pending)
+ // this: E F *G* (last must be committed)
// result: A B C *G*
- // This ignores the transient index of the source and honors that of 'this'.
- virtual void CopyStateFromAndPrune(NavigationController* source) = 0;
-
- // Removes all the entries except the active entry. If there is a new pending
- // navigation it is preserved.
- virtual void PruneAllButActive() = 0;
+ // If there is a pending entry after *G* in |this|, it is also preserved.
+ // This ignores any pending or transient entries in |source|, and it returns
+ // false if it is unsafe to call (see CanPruneAllButVisible).
+ virtual bool CopyStateFromAndPrune(NavigationController* source) = 0;
+
+ // Returns whether it is safe to call PruneAllButVisible or
+ // CopyStateFromAndPrune. There must be a last committed entry, no transient
+ // entry, and if there is a pending entry, it must be new and not an existing
+ // entry.
+ virtual bool CanPruneAllButVisible() = 0;
+
+ // Removes all the entries except the last committed entry. If there is a new
+ // pending navigation it is preserved. Returns false if it is unsafe to call
+ // (see CanPruneAllButVisible).
+ virtual bool PruneAllButVisible() = 0;
// Clears all screenshots associated with navigation entries in this
// controller. Useful to reduce memory consumption in low-memory situations.

Powered by Google App Engine
This is Rietveld 408576698