Commit 6c4ec3c0 authored by Min Qin's avatar Min Qin Committed by Commit Bot

Split some download CHECK message into a LOG message

CHECK messages are discarded for release build.
Using a separate LOG message should give us the error message
in logcat

BUG=1029746

Change-Id: Ia333ee1261ca33c0d9538a5f132af92ae394e347
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972233Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725688}
parent c5c7a467
......@@ -1468,9 +1468,14 @@ void DownloadItemImpl::Start(
URLLoaderFactoryProvider::URLLoaderFactoryProviderPtr
url_loader_factory_provider) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
CHECK(!download_file_) << "last interrupt reason: "
<< DownloadInterruptReasonToString(last_reason_)
<< ", state: " << DebugDownloadStateString(state_);
if (download_file_) {
LOG(ERROR) << "last interrupt reason: "
<< DownloadInterruptReasonToString(last_reason_)
<< ", state: " << DebugDownloadStateString(state_)
<< ", state before last interruption: "
<< DebugDownloadStateString(state_before_interruption_);
}
CHECK(!download_file_);
DVLOG(20) << __func__ << "() this=" << DebugString(true);
RecordDownloadCountWithSource(START_COUNT, download_source_);
......@@ -2116,6 +2121,7 @@ void DownloadItemImpl::InterruptWithPartialState(
// target-pending, which is something we don't want to do. Perhaps we should
// explicitly transition to target-resolved prior to switching to interrupted.
DCHECK_EQ(last_reason_, reason);
state_before_interruption_ = state_;
TransitionTo(INTERRUPTED_INTERNAL);
delegate_->DownloadInterrupted(this);
AutoResumeIfValid();
......
......@@ -730,6 +730,10 @@ class COMPONENTS_DOWNLOAD_EXPORT DownloadItemImpl
// The current state of this download.
DownloadInternalState state_ = INITIAL_INTERNAL;
// The state before download was interrupted.
// Remove this once http://crbug.com/1029746 is fixed.
DownloadInternalState state_before_interruption_ = INITIAL_INTERNAL;
// Current danger type for the download.
DownloadDangerType danger_type_ = DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
......
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