Use the last committed entry in DidStopLoading, not the pending entry.

BUG=233053
TEST=WebContentsImplBrowserTest.DidStopLoadingDetailsWithPending

Review URL: https://chromiumcodereview.appspot.com/14066022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195293 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d03ee6c..8612ef12 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2853,7 +2853,10 @@
 void WebContentsImpl::DidStopLoading(RenderViewHost* render_view_host) {
   scoped_ptr<LoadNotificationDetails> details;
 
-  NavigationEntry* entry = controller_.GetActiveEntry();
+  // Use the last committed entry rather than the active one, in case a
+  // pending entry has been created.
+  NavigationEntry* entry = controller_.GetLastCommittedEntry();
+
   // An entry may not exist for a stop when loading an initial blank page or
   // if an iframe injected by script into a blank page finishes loading.
   if (entry) {