Commit 9168fba2 authored by liaoyuke's avatar liaoyuke Committed by Commit bot

Add DCHECK that Reload should never be called with ReloadType::NONE

In ReloadType, NONE means that the navigation is not a reload, so it
makes no sense to call Reload function with ReloadType::NONE as
parameter.

This CL clarifies it by mentioning it in public API comment and add a
DCHECK in the implementation.

BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2740843004
Cr-Commit-Position: refs/heads/master@{#456129}
parent 5f8b72e3
...@@ -297,6 +297,8 @@ void NavigationControllerImpl::Restore( ...@@ -297,6 +297,8 @@ void NavigationControllerImpl::Restore(
void NavigationControllerImpl::Reload(ReloadType reload_type, void NavigationControllerImpl::Reload(ReloadType reload_type,
bool check_for_repost) { bool check_for_repost) {
DCHECK_NE(ReloadType::NONE, reload_type);
if (transient_entry_index_ != -1) { if (transient_entry_index_ != -1) {
// If an interstitial is showing, treat a reload as a navigation to the // If an interstitial is showing, treat a reload as a navigation to the
// transient entry's URL. // transient entry's URL.
......
...@@ -356,6 +356,7 @@ class NavigationController { ...@@ -356,6 +356,7 @@ class NavigationController {
// cases pass in true in production code, but would do false for testing, or // cases pass in true in production code, but would do false for testing, or
// in cases where no user interface is available for prompting. If a // in cases where no user interface is available for prompting. If a
// transient entry is showing, initiates a new navigation to its URL. // transient entry is showing, initiates a new navigation to its URL.
// NOTE: |reload_type| should never be NONE.
virtual void Reload(ReloadType reload_type, bool check_for_repost) = 0; virtual void Reload(ReloadType reload_type, bool check_for_repost) = 0;
// Removing of entries ------------------------------------------------------- // Removing of entries -------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment