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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1143333003: Eliminate redundancy in the parameters to NotifyEntryChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/public/browser/navigation_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 95352e39037f7de388debb2bc04e92fd0232a898..5f14984811db08f6298b5a2770962164945e68b7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3634,17 +3634,16 @@ void WebContentsImpl::UpdateState(RenderViewHost* rvh,
// leaving a page, in which case our state may have already been moved to
// the next page. The navigation controller will look up the appropriate
// NavigationEntry and update it when it is notified via the delegate.
-
- int entry_index = controller_.GetEntryIndexWithPageID(
+ NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
rvh->GetSiteInstance(), page_id);
- if (entry_index < 0)
+
+ if (!entry)
return;
- NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index);
if (page_state == entry->GetPageState())
return; // Nothing to update.
entry->SetPageState(page_state);
- controller_.NotifyEntryChanged(entry, entry_index);
+ controller_.NotifyEntryChanged(entry);
}
void WebContentsImpl::UpdateTargetURL(RenderViewHost* render_view_host,
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/public/browser/navigation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698