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

Side by Side Diff: content/browser/frame_host/frame_navigation_entry.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, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/frame_navigation_entry.h" 5 #include "content/browser/frame_host/frame_navigation_entry.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/debug/dump_without_crashing.h"
9 #include "content/common/page_state_serialization.h" 10 #include "content/common/page_state_serialization.h"
10 #include "content/common/site_isolation_policy.h" 11 #include "content/common/site_isolation_policy.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 FrameNavigationEntry::FrameNavigationEntry() 15 FrameNavigationEntry::FrameNavigationEntry()
15 : item_sequence_number_(-1), document_sequence_number_(-1), post_id_(-1) {} 16 : item_sequence_number_(-1), document_sequence_number_(-1), post_id_(-1) {}
16 17
17 FrameNavigationEntry::FrameNavigationEntry( 18 FrameNavigationEntry::FrameNavigationEntry(
18 const std::string& frame_unique_name, 19 const std::string& frame_unique_name,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const PageState& page_state, 59 const PageState& page_state,
59 const std::string& method, 60 const std::string& method,
60 int64_t post_id) { 61 int64_t post_id) {
61 frame_unique_name_ = frame_unique_name; 62 frame_unique_name_ = frame_unique_name;
62 item_sequence_number_ = item_sequence_number; 63 item_sequence_number_ = item_sequence_number;
63 document_sequence_number_ = document_sequence_number; 64 document_sequence_number_ = document_sequence_number;
64 site_instance_ = site_instance; 65 site_instance_ = site_instance;
65 source_site_instance_ = std::move(source_site_instance); 66 source_site_instance_ = std::move(source_site_instance);
66 url_ = url; 67 url_ = url;
67 referrer_ = referrer; 68 referrer_ = referrer;
69 if (!page_state.IsValid()) {
70 // Temporarily generate a minidump to diagnose https://crbug.com/568703.
71 base::debug::DumpWithoutCrashing();
72 NOTREACHED() << "Shouldn't set an empty PageState.";
73 }
68 page_state_ = page_state; 74 page_state_ = page_state;
69 method_ = method; 75 method_ = method;
70 post_id_ = post_id; 76 post_id_ = post_id;
71 } 77 }
72 78
73 void FrameNavigationEntry::set_item_sequence_number( 79 void FrameNavigationEntry::set_item_sequence_number(
74 int64_t item_sequence_number) { 80 int64_t item_sequence_number) {
75 // TODO(creis): Assert that this does not change after being assigned, once 81 // TODO(creis): Assert that this does not change after being assigned, once
76 // location.replace is classified as NEW_PAGE rather than EXISTING_PAGE. 82 // location.replace is classified as NEW_PAGE rather than EXISTING_PAGE.
77 // Same for document sequence number. See https://crbug.com/596707. 83 // Same for document sequence number. See https://crbug.com/596707.
(...skipping 13 matching lines...) Expand all
91 97
92 // Generate the body from the PageState. 98 // Generate the body from the PageState.
93 ExplodedPageState exploded_state; 99 ExplodedPageState exploded_state;
94 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state)) 100 if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state))
95 return nullptr; 101 return nullptr;
96 102
97 return exploded_state.top.http_body.request_body; 103 return exploded_state.top.http_body.request_body;
98 } 104 }
99 105
100 } // namespace content 106 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698