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

Unified Diff: chrome/browser/download/download_target_determiner.cc

Issue 1090323003: [chrome/browser/download] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/download/download_request_limiter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_target_determiner.cc
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
index f1f6e652c889f43775b5c82e7b1df1b124b10f88..7a7dfb88a73cb3702038f12105151d35572f02b5 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -100,7 +100,7 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
delegate_(delegate),
completion_callback_(callback),
weak_ptr_factory_(this) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(download_);
DCHECK(delegate);
download_->AddObserver(this);
@@ -109,7 +109,7 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
}
DownloadTargetDeterminer::~DownloadTargetDeterminer() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(download_);
DCHECK(completion_callback_.is_null());
download_->RemoveObserver(this);
@@ -170,7 +170,7 @@ void DownloadTargetDeterminer::DoLoop() {
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoGenerateTargetPath() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(local_path_.empty());
DCHECK(!should_prompt_);
DCHECK(!should_notify_extensions_);
@@ -240,7 +240,7 @@ DownloadTargetDeterminer::Result
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoNotifyExtensions() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_RESERVE_VIRTUAL_PATH;
@@ -257,7 +257,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::NotifyExtensionsDone(
const base::FilePath& suggested_path,
DownloadPathReservationTracker::FilenameConflictAction conflict_action) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Extension suggested path: " << suggested_path.AsUTF8Unsafe();
// Extensions should not call back here more than once.
@@ -289,7 +289,7 @@ void DownloadTargetDeterminer::NotifyExtensionsDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoReserveVirtualPath() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_PROMPT_USER_FOR_DOWNLOAD_PATH;
@@ -303,7 +303,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::ReserveVirtualPathDone(
const base::FilePath& path, bool verified) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Reserved path: " << path.AsUTF8Unsafe()
<< " Verified:" << verified;
DCHECK_EQ(STATE_PROMPT_USER_FOR_DOWNLOAD_PATH, next_state_);
@@ -315,7 +315,7 @@ void DownloadTargetDeterminer::ReserveVirtualPathDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoPromptUserForDownloadPath() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_DETERMINE_LOCAL_PATH;
@@ -333,7 +333,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::PromptUserForDownloadPathDone(
const base::FilePath& virtual_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "User selected path:" << virtual_path.AsUTF8Unsafe();
if (virtual_path.empty()) {
CancelOnFailureAndDeleteSelf();
@@ -348,7 +348,7 @@ void DownloadTargetDeterminer::PromptUserForDownloadPathDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineLocalPath() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(local_path_.empty());
@@ -364,7 +364,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::DetermineLocalPathDone(
const base::FilePath& local_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Local path: " << local_path.AsUTF8Unsafe();
if (local_path.empty()) {
// Path subsitution failed.
@@ -379,7 +379,7 @@ void DownloadTargetDeterminer::DetermineLocalPathDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineMimeType() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(!local_path_.empty());
DCHECK(mime_type_.empty());
@@ -398,7 +398,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::DetermineMimeTypeDone(
const std::string& mime_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "MIME type: " << mime_type;
DCHECK_EQ(STATE_DETERMINE_IF_HANDLED_SAFELY_BY_BROWSER, next_state_);
@@ -427,7 +427,7 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
const std::string& mime_type,
ActionOnStalePluginList stale_plugin_action,
const base::Callback<void(bool)>& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!mime_type.empty());
using content::WebPluginInfo;
@@ -472,7 +472,7 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineIfHandledSafely() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(!local_path_.empty());
DCHECK(!is_filetype_handled_safely_);
@@ -508,7 +508,7 @@ DownloadTargetDeterminer::Result
#if defined(ENABLE_PLUGINS)
void DownloadTargetDeterminer::DetermineIfHandledSafelyDone(
bool is_handled_safely) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Is file type handled safely: " << is_filetype_handled_safely_;
DCHECK_EQ(STATE_DETERMINE_IF_ADOBE_READER_UP_TO_DATE, next_state_);
is_filetype_handled_safely_ = is_handled_safely;
@@ -518,7 +518,7 @@ void DownloadTargetDeterminer::DetermineIfHandledSafelyDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineIfAdobeReaderUpToDate() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
next_state_ = STATE_CHECK_DOWNLOAD_URL;
@@ -545,7 +545,7 @@ DownloadTargetDeterminer::Result
#if defined(OS_WIN)
void DownloadTargetDeterminer::DetermineIfAdobeReaderUpToDateDone(
bool adobe_reader_up_to_date) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Is Adobe Reader Up To Date: " << adobe_reader_up_to_date;
DCHECK_EQ(STATE_CHECK_DOWNLOAD_URL, next_state_);
g_is_adobe_reader_up_to_date_ = adobe_reader_up_to_date;
@@ -555,7 +555,7 @@ void DownloadTargetDeterminer::DetermineIfAdobeReaderUpToDateDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckDownloadUrl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE;
delegate_->CheckDownloadUrl(
@@ -568,7 +568,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::CheckDownloadUrlDone(
content::DownloadDangerType danger_type) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "URL Check Result:" << danger_type;
DCHECK_EQ(STATE_CHECK_VISITED_REFERRER_BEFORE, next_state_);
danger_type_ = danger_type;
@@ -577,7 +577,7 @@ void DownloadTargetDeterminer::CheckDownloadUrlDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckVisitedReferrerBefore() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
next_state_ = STATE_DETERMINE_INTERMEDIATE_PATH;
@@ -625,7 +625,7 @@ DownloadTargetDeterminer::Result
void DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone(
bool visited_referrer_before) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
if (IsDangerousFile(visited_referrer_before ? VISITED_REFERRER
: NO_VISITS_TO_REFERRER)) {
@@ -638,7 +638,7 @@ void DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone(
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineIntermediatePath() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(!local_path_.empty());
DCHECK(intermediate_path_.empty());
@@ -810,7 +810,7 @@ bool DownloadTargetDeterminer::HasPromptedForPath() const {
}
bool DownloadTargetDeterminer::IsDangerousFile(PriorVisitsToReferrer visits) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// If the user has has been prompted or will be, assume that the user has
// approved the download. A programmatic download is considered safe unless it
@@ -869,7 +869,7 @@ bool DownloadTargetDeterminer::IsDangerousFile(PriorVisitsToReferrer visits) {
void DownloadTargetDeterminer::OnDownloadDestroyed(
DownloadItem* download) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(download_, download);
CancelOnFailureAndDeleteSelf();
}
« no previous file with comments | « chrome/browser/download/download_request_limiter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698