Fix the fixme introduced in crrev.com/154287

The issue is that the an output-only parameter (details.did_replace_entry) has its value upon input used as part of the logic. Changes some functions to make this case more obvious.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154571 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc
index e12f829..7151bfb 100644
--- a/content/browser/web_contents/navigation_controller_impl.cc
+++ b/content/browser/web_contents/navigation_controller_impl.cc
@@ -694,9 +694,8 @@
   // If we are doing a cross-site reload, we need to replace the existing
   // navigation entry, not add another entry to the history. This has the side
   // effect of removing forward browsing history, if such existed.
-  if (pending_entry_ != NULL) {
-    details->did_replace_entry = pending_entry_->is_cross_site_reload();
-  }
+  details->did_replace_entry =
+      pending_entry_ && pending_entry_->is_cross_site_reload();
 
   // is_in_page must be computed before the entry gets committed.
   details->is_in_page = IsURLInPageNavigation(
@@ -707,7 +706,7 @@
 
   switch (details->type) {
     case content::NAVIGATION_TYPE_NEW_PAGE:
-      RendererDidNavigateToNewPage(params, &(details->did_replace_entry));
+      RendererDidNavigateToNewPage(params, details->did_replace_entry);
       break;
     case content::NAVIGATION_TYPE_EXISTING_PAGE:
       RendererDidNavigateToExistingPage(params);
@@ -716,7 +715,7 @@
       RendererDidNavigateToSamePage(params);
       break;
     case content::NAVIGATION_TYPE_IN_PAGE:
-      RendererDidNavigateInPage(params, &(details->did_replace_entry));
+      RendererDidNavigateInPage(params, &details->did_replace_entry);
       break;
     case content::NAVIGATION_TYPE_NEW_SUBFRAME:
       RendererDidNavigateNewSubframe(params);
@@ -887,8 +886,10 @@
   // the time this doesn't matter since WebKit doesn't tell us about subframe
   // navigations that don't actually navigate, but it can happen when there is
   // an encoding override (it always sends a navigation request).
-  if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url, false))
+  if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url,
+                              params.was_within_same_page)) {
     return content::NAVIGATION_TYPE_IN_PAGE;
+  }
 
   // Since we weeded out "new" navigations above, we know this is an existing
   // (back/forward) navigation.
@@ -906,7 +907,7 @@
 }
 
 void NavigationControllerImpl::RendererDidNavigateToNewPage(
-    const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry) {
+   const ViewHostMsg_FrameNavigate_Params& params, bool replace_entry) {
   NavigationEntryImpl* new_entry;
   bool update_virtual_url;
   if (pending_entry_) {
@@ -942,7 +943,7 @@
   new_entry->SetOriginalRequestURL(params.original_request_url);
   new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent);
 
-  InsertOrReplaceEntry(new_entry, *did_replace_entry);
+  InsertOrReplaceEntry(new_entry, replace_entry);
 }
 
 void NavigationControllerImpl::RendererDidNavigateToExistingPage(