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

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: Rebase 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 4000083732f8b3a95f64077404c6725a9fc57d2a..7613d586501cb96f8ed231cd6fd19c9bc00e2ad9 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -1009,7 +1009,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