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

Unified Diff: net/url_request/url_fetcher_core.cc

Issue 2894863002: Rename TaskRunner::RunsTasksOnCurrentThread() in //net (Closed)
Patch Set: fixed build error Created 3 years, 7 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 | « net/url_request/test_url_request_interceptor.cc ('k') | net/url_request/url_fetcher_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_fetcher_core.cc
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index a320f4857879e65455d947ed2289005410d61dd5..7ec0133abd0c26e02e8f894716be581753cb073b 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -141,13 +141,13 @@ void URLFetcherCore::Start() {
void URLFetcherCore::Stop() {
if (delegate_task_runner_) // May be NULL in tests.
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
delegate_ = NULL;
fetcher_ = NULL;
if (!network_task_runner_.get())
return;
- if (network_task_runner_->RunsTasksOnCurrentThread()) {
+ if (network_task_runner_->RunsTasksInCurrentSequence()) {
CancelURLRequest(ERR_ABORTED);
} else {
network_task_runner_->PostTask(
@@ -305,21 +305,21 @@ void URLFetcherCore::SetAutomaticallyRetryOnNetworkChanges(int max_retries) {
void URLFetcherCore::SaveResponseToFileAtPath(
const base::FilePath& file_path,
scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
SaveResponseWithWriter(std::unique_ptr<URLFetcherResponseWriter>(
new URLFetcherFileWriter(file_task_runner, file_path)));
}
void URLFetcherCore::SaveResponseToTemporaryFile(
scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
SaveResponseWithWriter(std::unique_ptr<URLFetcherResponseWriter>(
new URLFetcherFileWriter(file_task_runner, base::FilePath())));
}
void URLFetcherCore::SaveResponseWithWriter(
std::unique_ptr<URLFetcherResponseWriter> response_writer) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
response_writer_ = std::move(response_writer);
}
@@ -367,7 +367,7 @@ int URLFetcherCore::GetResponseCode() const {
}
void URLFetcherCore::ReceivedContentWasMalformed() {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
if (network_task_runner_.get()) {
network_task_runner_->PostTask(
FROM_HERE, base::Bind(&URLFetcherCore::NotifyMalformedContent, this));
@@ -389,7 +389,7 @@ bool URLFetcherCore::GetResponseAsString(
bool URLFetcherCore::GetResponseAsFilePath(bool take_ownership,
base::FilePath* out_response_path) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
URLFetcherFileWriter* file_writer =
response_writer_ ? response_writer_->AsFileWriter() : NULL;
@@ -735,7 +735,7 @@ void URLFetcherCore::CancelURLRequest(int error) {
void URLFetcherCore::OnCompletedURLRequest(
base::TimeDelta backoff_delay) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
// Save the status and backoff_delay so that delegates can read it.
if (delegate_) {
@@ -745,7 +745,7 @@ void URLFetcherCore::OnCompletedURLRequest(
}
void URLFetcherCore::InformDelegateFetchIsComplete() {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
if (delegate_)
delegate_->OnURLFetchComplete(fetcher_);
}
@@ -949,7 +949,7 @@ void URLFetcherCore::InformDelegateUploadProgress() {
void URLFetcherCore::InformDelegateUploadProgressInDelegateSequence(
int64_t current,
int64_t total) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
if (delegate_)
delegate_->OnURLFetchUploadProgress(fetcher_, current, total);
}
@@ -974,7 +974,7 @@ void URLFetcherCore::InformDelegateDownloadProgressInDelegateSequence(
int64_t current,
int64_t total,
int64_t current_network_bytes) {
- DCHECK(delegate_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(delegate_task_runner_->RunsTasksInCurrentSequence());
if (delegate_)
delegate_->OnURLFetchDownloadProgress(fetcher_, current, total,
current_network_bytes);
« no previous file with comments | « net/url_request/test_url_request_interceptor.cc ('k') | net/url_request/url_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698