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

Side by Side Diff: content/browser/frame_host/navigation_controller_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, 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_entry_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 21 matching lines...) Expand all
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35 35
36 #include "content/browser/frame_host/navigation_controller_impl.h" 36 #include "content/browser/frame_host/navigation_controller_impl.h"
37 37
38 #include <utility> 38 #include <utility>
39 39
40 #include "base/bind.h" 40 #include "base/bind.h"
41 #include "base/command_line.h" 41 #include "base/command_line.h"
42 #include "base/debug/dump_without_crashing.h"
42 #include "base/logging.h" 43 #include "base/logging.h"
43 #include "base/memory/ptr_util.h" 44 #include "base/memory/ptr_util.h"
44 #include "base/metrics/histogram.h" 45 #include "base/metrics/histogram.h"
45 #include "base/strings/string_number_conversions.h" // Temporary 46 #include "base/strings/string_number_conversions.h" // Temporary
46 #include "base/strings/string_util.h" 47 #include "base/strings/string_util.h"
47 #include "base/strings/utf_string_conversions.h" 48 #include "base/strings/utf_string_conversions.h"
48 #include "base/time/time.h" 49 #include "base/time/time.h"
49 #include "base/trace_event/trace_event.h" 50 #include "base/trace_event/trace_event.h"
50 #include "build/build_config.h" 51 #include "build/build_config.h"
51 #include "cc/base/switches.h" 52 #include "cc/base/switches.h"
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 time_smoother_.GetSmoothedTime(get_timestamp_callback_.Run()); 861 time_smoother_.GetSmoothedTime(get_timestamp_callback_.Run());
861 DVLOG(1) << "Navigation finished at (smoothed) timestamp " 862 DVLOG(1) << "Navigation finished at (smoothed) timestamp "
862 << timestamp.ToInternalValue(); 863 << timestamp.ToInternalValue();
863 864
864 // We should not have a pending entry anymore. Clear it again in case any 865 // We should not have a pending entry anymore. Clear it again in case any
865 // error cases above forgot to do so. 866 // error cases above forgot to do so.
866 DiscardNonCommittedEntriesInternal(); 867 DiscardNonCommittedEntriesInternal();
867 868
868 // All committed entries should have nonempty content state so WebKit doesn't 869 // All committed entries should have nonempty content state so WebKit doesn't
869 // get confused when we go back to them (see the function for details). 870 // get confused when we go back to them (see the function for details).
870 DCHECK(params.page_state.IsValid()); 871 if (!params.page_state.IsValid()) {
872 // Temporarily generate a minidump to diagnose https://crbug.com/568703.
873 base::debug::DumpWithoutCrashing();
874 NOTREACHED() << "Shouldn't see an empty PageState at commit.";
875 }
871 NavigationEntryImpl* active_entry = GetLastCommittedEntry(); 876 NavigationEntryImpl* active_entry = GetLastCommittedEntry();
872 active_entry->SetTimestamp(timestamp); 877 active_entry->SetTimestamp(timestamp);
873 active_entry->SetHttpStatusCode(params.http_status_code); 878 active_entry->SetHttpStatusCode(params.http_status_code);
874 879
875 FrameNavigationEntry* frame_entry = 880 FrameNavigationEntry* frame_entry =
876 active_entry->GetFrameEntry(rfh->frame_tree_node()); 881 active_entry->GetFrameEntry(rfh->frame_tree_node());
877 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { 882 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
878 // Update the frame-specific PageState. 883 // Update the frame-specific PageState.
879 // We may not find a frame_entry in some cases; ignore the PageState if so. 884 // We may not find a frame_entry in some cases; ignore the PageState if so.
880 // TODO(creis): Remove the "if" once https://crbug.com/522193 is fixed. 885 // TODO(creis): Remove the "if" once https://crbug.com/522193 is fixed.
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 } 2104 }
2100 } 2105 }
2101 } 2106 }
2102 2107
2103 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2108 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2104 const base::Callback<base::Time()>& get_timestamp_callback) { 2109 const base::Callback<base::Time()>& get_timestamp_callback) {
2105 get_timestamp_callback_ = get_timestamp_callback; 2110 get_timestamp_callback_ = get_timestamp_callback;
2106 } 2111 }
2107 2112
2108 } // namespace content 2113 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698