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

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: Allow empty state on new navs. 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..97413c7b639baf003f4afc20a781f3c034f989d5 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) {
@@ -745,6 +751,14 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
return;
}
+ // We should only have an empty PageState if the navigation is new, and thus
+ // page ID is -1.
+ if (!page_state.IsValid() && GetPageID() != -1) {
+ // Temporarily generate a minidump to diagnose https://crbug.com/568703.
+ base::debug::DumpWithoutCrashing();
+ NOTREACHED() << "Shouldn't set an empty PageState.";
+ }
+
// Now check whether we have a TreeNode for the node itself.
const std::string& unique_name = frame_tree_node->unique_name();
for (TreeNode* child : parent_node->children) {
« 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