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

Unified Diff: chrome/browser/ui/browser_commands.cc

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: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 27da5db41d9150a8ea2f8ea5ad5aeb71a62d8f07..f47ffcbd61b228124cf77216ee07e7acb06ba00e 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -1003,7 +1003,9 @@ void ViewSource(Browser* browser,
// Note that Clone does not copy the pending or transient entries, so the
// active entry in view_source_contents will be the last committed entry.
WebContents* view_source_contents = contents->Clone();
- view_source_contents->GetController().PruneAllButActive();
+ DCHECK(view_source_contents->GetController().CanPruneAllButVisible());
+ if (!view_source_contents->GetController().PruneAllButVisible())
+ return;
NavigationEntry* active_entry =
view_source_contents->GetController().GetActiveEntry();
if (!active_entry)

Powered by Google App Engine
This is Rietveld 408576698