summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorcreis <creis@chromium.org>2015-11-05 16:58:00 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-06 00:59:51 +0000
commita67bd94373bfe81c29d2a0cfd7ae956f899eeece (patch)
tree4b297678e9ad4b8257e73c1999a0d0a19895c9dc /content
parent792d166cc4ccd33d2e52726103627b0cc5b5aa60 (diff)
downloadchromium_src-a67bd94373bfe81c29d2a0cfd7ae956f899eeece.zip
chromium_src-a67bd94373bfe81c29d2a0cfd7ae956f899eeece.tar.gz
chromium_src-a67bd94373bfe81c29d2a0cfd7ae956f899eeece.tar.bz2
Gather more debug info for the switch away from page id for titles and state.
This is temporary and can be reverted after we observe crashes (or none). BUG=369661 TEST=Watch for crashes in UpdateState and UpdateTitle Review URL: https://codereview.chromium.org/1410543014 Cr-Commit-Position: refs/heads/master@{#358213}
Diffstat (limited to 'content')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc62
-rw-r--r--content/public/common/page_state.cc10
-rw-r--r--content/public/common/page_state.h1
3 files changed, 65 insertions, 8 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4a8ec86..383f867 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/command_line.h"
+#include "base/debug/crash_logging.h"
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/logging.h"
@@ -3890,13 +3891,36 @@ void WebContentsImpl::UpdateState(RenderViewHost* rvh,
RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh);
NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
rvhi->GetSiteInstance(), page_id);
- if (!entry)
- return;
- NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
- static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame())->nav_entry_id());
+ int nav_entry_id =
+ static_cast<RenderFrameHostImpl*>(rvhi->GetMainFrame())->nav_entry_id();
+ NavigationEntryImpl* new_entry =
+ controller_.GetEntryWithUniqueID(nav_entry_id);
+
+ base::debug::SetCrashKeyValue("pageid", base::IntToString(page_id));
+ base::debug::SetCrashKeyValue("navuniqueid", base::IntToString(nav_entry_id));
+ base::debug::SetCrashKeyValue(
+ "oldindex", base::IntToString(controller_.GetIndexOfEntry(entry)));
+ base::debug::SetCrashKeyValue(
+ "newindex", base::IntToString(controller_.GetIndexOfEntry(new_entry)));
+ base::debug::SetCrashKeyValue(
+ "lastcommittedindex",
+ base::IntToString(controller_.GetLastCommittedEntryIndex()));
+ base::debug::SetCrashKeyValue("oldurl",
+ entry ? entry->GetURL().spec() : "-nullptr-");
+ base::debug::SetCrashKeyValue(
+ "newurl", new_entry ? new_entry->GetURL().spec() : "-nullptr-");
+ base::debug::SetCrashKeyValue(
+ "updatedvalue", page_state.GetTopLevelUrlStringTemporaryForBug369661());
+ base::debug::SetCrashKeyValue(
+ "oldvalue", entry ? entry->GetURL().spec() : "-nullptr-");
+ base::debug::SetCrashKeyValue(
+ "newvalue",
+ new_entry ? new_entry->GetURL().spec() : "-nullptr-");
+ CHECK_EQ(entry, new_entry);
- DCHECK_EQ(entry, new_entry);
+ if (!entry)
+ return;
if (page_state == entry->GetPageState())
return; // Nothing to update.
@@ -4099,9 +4123,31 @@ void WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host,
NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
render_frame_host->GetSiteInstance(), page_id);
- NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
- static_cast<RenderFrameHostImpl*>(render_frame_host)->nav_entry_id());
- DCHECK_EQ(entry, new_entry);
+ int nav_entry_id =
+ static_cast<RenderFrameHostImpl*>(render_frame_host)->nav_entry_id();
+ NavigationEntryImpl* new_entry =
+ controller_.GetEntryWithUniqueID(nav_entry_id);
+
+ base::debug::SetCrashKeyValue("pageid", base::IntToString(page_id));
+ base::debug::SetCrashKeyValue("navuniqueid", base::IntToString(nav_entry_id));
+ base::debug::SetCrashKeyValue(
+ "oldindex", base::IntToString(controller_.GetIndexOfEntry(entry)));
+ base::debug::SetCrashKeyValue(
+ "newindex", base::IntToString(controller_.GetIndexOfEntry(new_entry)));
+ base::debug::SetCrashKeyValue(
+ "lastcommittedindex",
+ base::IntToString(controller_.GetLastCommittedEntryIndex()));
+ base::debug::SetCrashKeyValue("oldurl",
+ entry ? entry->GetURL().spec() : "-nullptr-");
+ base::debug::SetCrashKeyValue(
+ "newurl", new_entry ? new_entry->GetURL().spec() : "-nullptr-");
+ base::debug::SetCrashKeyValue("updatedvalue", base::UTF16ToUTF8(title));
+ base::debug::SetCrashKeyValue(
+ "oldvalue", entry ? base::UTF16ToUTF8(entry->GetTitle()) : "-nullptr-");
+ base::debug::SetCrashKeyValue(
+ "newvalue",
+ new_entry ? base::UTF16ToUTF8(new_entry->GetTitle()) : "-nullptr-");
+ CHECK_EQ(entry, new_entry);
// We can handle title updates when we don't have an entry in
// UpdateTitleForEntry, but only if the update is from the current RVH.
diff --git a/content/public/common/page_state.cc b/content/public/common/page_state.cc
index 9d100d3..6174a845 100644
--- a/content/public/common/page_state.cc
+++ b/content/public/common/page_state.cc
@@ -5,6 +5,7 @@
#include "content/public/common/page_state.h"
#include "base/files/file_path.h"
+#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "content/common/page_state_serialization.h"
@@ -119,6 +120,15 @@ const std::string& PageState::ToEncodedData() const {
return data_;
}
+std::string PageState::GetTopLevelUrlStringTemporaryForBug369661() const {
+ ExplodedPageState state;
+ CHECK(DecodePageState(data_, &state));
+
+ base::NullableString16& url_string = state.top.url_string;
+ CHECK(!url_string.is_null());
+ return base::UTF16ToUTF8(url_string.string());
+}
+
std::vector<base::FilePath> PageState::GetReferencedFiles() const {
std::vector<base::FilePath> results;
diff --git a/content/public/common/page_state.h b/content/public/common/page_state.h
index c38f961..78782a2 100644
--- a/content/public/common/page_state.h
+++ b/content/public/common/page_state.h
@@ -40,6 +40,7 @@ class CONTENT_EXPORT PageState {
bool IsValid() const;
bool Equals(const PageState& page_state) const;
const std::string& ToEncodedData() const;
+ std::string GetTopLevelUrlStringTemporaryForBug369661() const;
std::vector<base::FilePath> GetReferencedFiles() const;
PageState RemovePasswordData() const;