Index: content/browser/frame_host/navigation_controller_impl.cc |
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc |
index 23de865a73e75b4a998768641394ad70a35f4c71..e06a3866c44e1e037e5e40f3e8053a8d68d6d1d1 100644 |
--- a/content/browser/frame_host/navigation_controller_impl.cc |
+++ b/content/browser/frame_host/navigation_controller_impl.cc |
@@ -39,6 +39,7 @@ |
#include "base/bind.h" |
#include "base/command_line.h" |
+#include "base/debug/alias.h" |
#include "base/debug/dump_without_crashing.h" |
#include "base/logging.h" |
#include "base/memory/ptr_util.h" |
@@ -164,6 +165,35 @@ bool ShouldTreatNavigationAsReload(const NavigationEntry* entry) { |
return false; |
} |
+// TODO(estark): remove this DumpWithoutCrashing after investigating |
+// https://crbug.com/688425. |
+void MaybeDumpCopiedNonSameOriginEntry( |
+ const std::string& navigation_description, |
+ const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
+ bool is_in_page, |
+ NavigationEntry* entry) { |
+ if (!entry) |
+ return; |
+ if (url::Origin(entry->GetURL()).IsSameOriginWith(url::Origin(params.url))) |
+ return; |
+ |
+ std::string debug_info = |
+ navigation_description + ": " + |
+ std::string(is_in_page ? "Is in page, " : "Is not in page, ") + |
+ std::string(params.nav_entry_id ? "has nav entry id, " |
+ : "does not have nav entry id, ") + |
+ std::string(params.did_create_new_entry ? "did create new entry, " |
+ : "did not create new entry, ") + |
+ std::string(params.should_replace_current_entry |
+ ? "should replace current entry, " |
+ : "should not replace current entry, ") + |
+ entry->GetURL().spec() + " -> " + params.url.spec(); |
+ char debug_buf[2000]; |
+ base::strlcpy(debug_buf, debug_info.c_str(), arraysize(debug_buf)); |
+ base::debug::Alias(&debug_buf); |
+ base::debug::DumpWithoutCrashing(); |
+} |
+ |
} // namespace |
// NavigationControllerImpl ---------------------------------------------------- |
@@ -1105,6 +1135,9 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage( |
CHECK(frame_entry->HasOneRef()); |
update_virtual_url = new_entry->update_virtual_url_with_url(); |
+ |
+ MaybeDumpCopiedNonSameOriginEntry("New page navigation", params, is_in_page, |
+ GetLastCommittedEntry()); |
} |
// Only make a copy of the pending entry if it is appropriate for the new page |
@@ -1209,6 +1242,8 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage( |
// meanwhile and no new page was created. We are stuck at the last committed |
// entry. |
entry = GetLastCommittedEntry(); |
+ MaybeDumpCopiedNonSameOriginEntry("Existing page navigation", params, |
+ is_in_page, entry); |
} else if (params.nav_entry_id) { |
// This is a browser-initiated navigation (back/forward/reload). |
entry = GetEntryWithUniqueID(params.nav_entry_id); |