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

Unified Diff: content/browser/download/download_browsertest.cc

Issue 1008613002: favor DCHECK_CURRENTLY_ON for better logs in content/browser/[a-d]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « content/browser/download/base_file_win.cc ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index a129f238b80b462c8e88d9074a2fd405ea7f131f..f0ffbe3140624844781f1fd1c9fab1bcc6ea80d2 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -201,7 +201,7 @@ DownloadFileWithDelay::~DownloadFileWithDelay() {}
void DownloadFileWithDelay::RenameAndUniquify(
const base::FilePath& full_path,
const RenameCompletionCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DownloadFileImpl::RenameAndUniquify(
full_path, base::Bind(DownloadFileWithDelay::RenameCallbackWrapper,
owner_, callback));
@@ -209,7 +209,7 @@ void DownloadFileWithDelay::RenameAndUniquify(
void DownloadFileWithDelay::RenameAndAnnotate(
const base::FilePath& full_path, const RenameCompletionCallback& callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DownloadFileImpl::RenameAndAnnotate(
full_path, base::Bind(DownloadFileWithDelay::RenameCallbackWrapper,
owner_, callback));
@@ -221,7 +221,7 @@ void DownloadFileWithDelay::RenameCallbackWrapper(
const RenameCompletionCallback& original_callback,
DownloadInterruptReason reason,
const base::FilePath& path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!factory)
return;
factory->AddRenameCallback(base::Bind(original_callback, reason, path));
@@ -252,7 +252,7 @@ DownloadFile* DownloadFileWithDelayFactory::CreateFile(
}
void DownloadFileWithDelayFactory::AddRenameCallback(base::Closure callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
rename_callbacks_.push_back(callback);
if (waiting_)
base::MessageLoopForUI::current()->Quit();
@@ -260,12 +260,12 @@ void DownloadFileWithDelayFactory::AddRenameCallback(base::Closure callback) {
void DownloadFileWithDelayFactory::GetAllRenameCallbacks(
std::vector<base::Closure>* results) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
results->swap(rename_callbacks_);
}
void DownloadFileWithDelayFactory::WaitForSomeCallback() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (rename_callbacks_.empty()) {
waiting_ = true;
@@ -291,18 +291,18 @@ class CountingDownloadFile : public DownloadFileImpl {
stream.Pass(), bound_net_log, observer) {}
~CountingDownloadFile() override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
active_files_--;
}
void Initialize(const InitializeCallback& callback) override {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
active_files_++;
return DownloadFileImpl::Initialize(callback);
}
static void GetNumberActiveFiles(int* result) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
*result = active_files_;
}
@@ -470,7 +470,7 @@ class DownloadCreateObserver : DownloadManager::Observer {
}
DownloadItem* WaitForFinished() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!item_) {
waiting_ = true;
RunMessageLoop();
« no previous file with comments | « content/browser/download/base_file_win.cc ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698