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

Unified Diff: content/browser/frame_host/navigation_entry_impl.cc

Issue 2191563004: Temporarily dump without crashing when setting an empty PageState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also catch UpdateEntry Created 4 years, 5 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
Index: content/browser/frame_host/navigation_entry_impl.cc
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 9250e6811a31745d126c71bf78b67cae448382cd..c4c9f060d9022939433923f21a5d2f8fee7feb62 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -9,6 +9,7 @@
#include <queue>
#include <utility>
+#include "base/debug/dump_without_crashing.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
@@ -52,6 +53,11 @@ void RecursivelyGenerateFrameEntries(const ExplodedFrameState& state,
page_state.top = state;
std::string data;
EncodePageState(page_state, &data);
+ if (data.empty()) {
+ // Temporarily generate a minidump to diagnose https://crbug.com/568703.
+ base::debug::DumpWithoutCrashing();
+ NOTREACHED() << "Shouldn't generate an empty PageState.";
+ }
node->frame_entry->set_page_state(PageState::CreateFromEncodedData(data));
for (const ExplodedFrameState& child_state : state.children) {
@@ -771,6 +777,11 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
unique_name, item_sequence_number, document_sequence_number,
site_instance, std::move(source_site_instance), url, referrer, method,
post_id);
+ if (!page_state.IsValid()) {
+ // Temporarily generate a minidump to diagnose https://crbug.com/568703.
+ base::debug::DumpWithoutCrashing();
+ NOTREACHED() << "Shouldn't set an empty PageState.";
+ }
frame_entry->set_page_state(page_state);
parent_node->children.push_back(
new NavigationEntryImpl::TreeNode(frame_entry));
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698