summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-12 01:09:56 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-12 01:09:56 +0000
commit0b5ab509aa9324709b11a61f293920fc22a680e0 (patch)
tree06782fb5a14eb427d750b98ace9757739ace1ddc
parent0181a7d0055f4b77c494917bc49ab8cb93f5602c (diff)
downloadchromium_src-0b5ab509aa9324709b11a61f293920fc22a680e0.zip
chromium_src-0b5ab509aa9324709b11a61f293920fc22a680e0.tar.gz
chromium_src-0b5ab509aa9324709b11a61f293920fc22a680e0.tar.bz2
net: Use SequencedTaskRunner for URLFetcherResponseWriter
TBR=scottbyer@chromium.org for chrome/service/cloud_print/cloud_print_url_fetcher.h BUG=316065 TEST=build Review URL: https://codereview.chromium.org/63923002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234357 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/contacts/gdata_contacts_service.cc3
-rw-r--r--chrome/browser/drive/drive_api_service.cc3
-rw-r--r--chrome/browser/drive/drive_api_service.h6
-rw-r--r--chrome/browser/drive/drive_service_interface.h4
-rw-r--r--chrome/browser/drive/gdata_wapi_service.cc3
-rw-r--r--chrome/browser/drive/gdata_wapi_service.h6
-rw-r--r--chrome/browser/google_apis/base_requests.cc5
-rw-r--r--chrome/browser/google_apis/base_requests.h4
-rw-r--r--chrome/browser/google_apis/drive_api_requests.cc1
-rw-r--r--chrome/browser/google_apis/drive_api_requests.h1
-rw-r--r--chrome/browser/google_apis/gdata_contacts_requests.h1
-rw-r--r--chrome/browser/google_apis/gdata_wapi_requests.cc1
-rw-r--r--chrome/browser/google_apis/request_sender.cc3
-rw-r--r--chrome/browser/google_apis/request_sender.h8
-rw-r--r--chrome/browser/sync_file_system/drive_backend_v1/api_util.cc9
-rw-r--r--chrome/browser/sync_file_system/sync_file_system_service_factory.cc3
-rw-r--r--chrome/service/cloud_print/cloud_print_url_fetcher.h1
-rw-r--r--net/url_request/test_url_fetcher_factory.cc4
-rw-r--r--net/url_request/test_url_fetcher_factory.h4
-rw-r--r--net/url_request/url_fetcher.h7
-rw-r--r--net/url_request/url_fetcher_core.cc5
-rw-r--r--net/url_request/url_fetcher_core.h4
-rw-r--r--net/url_request/url_fetcher_impl.cc5
-rw-r--r--net/url_request/url_fetcher_impl.h4
-rw-r--r--net/url_request/url_fetcher_response_writer.cc4
-rw-r--r--net/url_request/url_fetcher_response_writer.h9
26 files changed, 66 insertions, 42 deletions
diff --git a/chrome/browser/chromeos/contacts/gdata_contacts_service.cc b/chrome/browser/chromeos/contacts/gdata_contacts_service.cc
index baffae3..35e0cde 100644
--- a/chrome/browser/chromeos/contacts/gdata_contacts_service.cc
+++ b/chrome/browser/chromeos/contacts/gdata_contacts_service.cc
@@ -855,7 +855,8 @@ GDataContactsService::GDataContactsService(
sender_.reset(new google_apis::RequestSender(
auth_service,
url_request_context_getter,
- content::BrowserThread::GetBlockingPool(),
+ BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
+ BrowserThread::GetBlockingPool()->GetSequenceToken()).get(),
"" /* custom_user_agent */));
}
diff --git a/chrome/browser/drive/drive_api_service.cc b/chrome/browser/drive/drive_api_service.cc
index ccd60f5..eb6bae5 100644
--- a/chrome/browser/drive/drive_api_service.cc
+++ b/chrome/browser/drive/drive_api_service.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/sequenced_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/task_runner_util.h"
#include "base/values.h"
@@ -282,7 +283,7 @@ const char kDriveApiRootDirectoryResourceId[] = "root";
DriveAPIService::DriveAPIService(
OAuth2TokenService* oauth2_token_service,
net::URLRequestContextGetter* url_request_context_getter,
- base::TaskRunner* blocking_task_runner,
+ base::SequencedTaskRunner* blocking_task_runner,
const GURL& base_url,
const GURL& base_download_url,
const GURL& wapi_base_url,
diff --git a/chrome/browser/drive/drive_api_service.h b/chrome/browser/drive/drive_api_service.h
index 2deed68..5606d2b 100644
--- a/chrome/browser/drive/drive_api_service.h
+++ b/chrome/browser/drive/drive_api_service.h
@@ -21,7 +21,7 @@ class OAuth2TokenService;
namespace base {
class FilePath;
-class TaskRunner;
+class SequencedTaskRunner;
}
namespace google_apis {
@@ -54,7 +54,7 @@ class DriveAPIService : public DriveServiceInterface,
DriveAPIService(
OAuth2TokenService* oauth2_token_service,
net::URLRequestContextGetter* url_request_context_getter,
- base::TaskRunner* blocking_task_runner,
+ base::SequencedTaskRunner* blocking_task_runner,
const GURL& base_url,
const GURL& base_download_url,
const GURL& wapi_base_url,
@@ -195,7 +195,7 @@ class DriveAPIService : public DriveServiceInterface,
OAuth2TokenService* oauth2_token_service_;
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
- scoped_refptr<base::TaskRunner> blocking_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
scoped_ptr<google_apis::RequestSender> sender_;
ObserverList<DriveServiceObserver> observers_;
google_apis::DriveApiUrlGenerator url_generator_;
diff --git a/chrome/browser/drive/drive_service_interface.h b/chrome/browser/drive/drive_service_interface.h
index 9ff3be6..0770a63 100644
--- a/chrome/browser/drive/drive_service_interface.h
+++ b/chrome/browser/drive/drive_service_interface.h
@@ -11,6 +11,10 @@
#include "chrome/browser/google_apis/base_requests.h"
#include "chrome/browser/google_apis/drive_common_callbacks.h"
+namespace base {
+class Time;
+}
+
namespace drive {
// Function which converts the given resource ID into the desired format.
diff --git a/chrome/browser/drive/gdata_wapi_service.cc b/chrome/browser/drive/gdata_wapi_service.cc
index 963c6ae..262da0b 100644
--- a/chrome/browser/drive/gdata_wapi_service.cc
+++ b/chrome/browser/drive/gdata_wapi_service.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/sequenced_task_runner.h"
#include "base/values.h"
#include "chrome/browser/drive/drive_api_util.h"
#include "chrome/browser/google_apis/auth_service.h"
@@ -128,7 +129,7 @@ void ConvertAppListAndRun(
GDataWapiService::GDataWapiService(
OAuth2TokenService* oauth2_token_service,
net::URLRequestContextGetter* url_request_context_getter,
- base::TaskRunner* blocking_task_runner,
+ base::SequencedTaskRunner* blocking_task_runner,
const GURL& base_url,
const GURL& base_download_url,
const std::string& custom_user_agent)
diff --git a/chrome/browser/drive/gdata_wapi_service.h b/chrome/browser/drive/gdata_wapi_service.h
index c490e49..8c4a029 100644
--- a/chrome/browser/drive/gdata_wapi_service.h
+++ b/chrome/browser/drive/gdata_wapi_service.h
@@ -22,7 +22,7 @@ class OAuth2TokenService;
namespace base {
class FilePath;
-class TaskRunner;
+class SequencedTaskRunner;
}
namespace google_apis {
@@ -51,7 +51,7 @@ class GDataWapiService : public DriveServiceInterface,
// requests issued through the service if the value is not empty.
GDataWapiService(OAuth2TokenService* oauth2_token_service,
net::URLRequestContextGetter* url_request_context_getter,
- base::TaskRunner* blocking_task_runner,
+ base::SequencedTaskRunner* blocking_task_runner,
const GURL& base_url,
const GURL& base_download_url,
const std::string& custom_user_agent);
@@ -191,7 +191,7 @@ class GDataWapiService : public DriveServiceInterface,
OAuth2TokenService* oauth2_token_service_; // Not owned.
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
- scoped_refptr<base::TaskRunner> blocking_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
scoped_ptr<google_apis::RequestSender> sender_;
ObserverList<DriveServiceObserver> observers_;
// Request objects should hold a copy of this, rather than a const
diff --git a/chrome/browser/google_apis/base_requests.cc b/chrome/browser/google_apis/base_requests.cc
index e349517..9b8692e 100644
--- a/chrome/browser/google_apis/base_requests.cc
+++ b/chrome/browser/google_apis/base_requests.cc
@@ -6,6 +6,7 @@
#include "base/json/json_reader.h"
#include "base/location.h"
+#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task_runner_util.h"
@@ -102,7 +103,7 @@ void ParseJson(base::TaskRunner* blocking_task_runner,
}
//=========================== ResponseWriter ==================================
-ResponseWriter::ResponseWriter(base::TaskRunner* file_task_runner,
+ResponseWriter::ResponseWriter(base::SequencedTaskRunner* file_task_runner,
const base::FilePath& file_path,
const GetContentCallback& get_content_callback)
: get_content_callback_(get_content_callback) {
@@ -302,7 +303,7 @@ bool UrlFetchRequestBase::CalledOnValidThread() {
return thread_checker_.CalledOnValidThread();
}
-base::TaskRunner* UrlFetchRequestBase::blocking_task_runner() const {
+base::SequencedTaskRunner* UrlFetchRequestBase::blocking_task_runner() const {
return sender_->blocking_task_runner();
}
diff --git a/chrome/browser/google_apis/base_requests.h b/chrome/browser/google_apis/base_requests.h
index 6ebdcf6..dec3031 100644
--- a/chrome/browser/google_apis/base_requests.h
+++ b/chrome/browser/google_apis/base_requests.h
@@ -94,7 +94,7 @@ class ResponseWriter : public net::URLFetcherResponseWriter {
public:
// If file_path is not empty, the response will be saved with file_writer_,
// otherwise it will be saved to data_.
- ResponseWriter(base::TaskRunner* file_task_runner,
+ ResponseWriter(base::SequencedTaskRunner* file_task_runner,
const base::FilePath& file_path,
const GetContentCallback& get_content_callback);
virtual ~ResponseWriter();
@@ -193,7 +193,7 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
ResponseWriter* response_writer() const { return response_writer_; }
// Returns the task runner that should be used for blocking tasks.
- base::TaskRunner* blocking_task_runner() const;
+ base::SequencedTaskRunner* blocking_task_runner() const;
private:
// URLFetcherDelegate overrides.
diff --git a/chrome/browser/google_apis/drive_api_requests.cc b/chrome/browser/google_apis/drive_api_requests.cc
index fc21c1a..8747adb 100644
--- a/chrome/browser/google_apis/drive_api_requests.cc
+++ b/chrome/browser/google_apis/drive_api_requests.cc
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/json/json_writer.h"
#include "base/location.h"
+#include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h"
#include "base/values.h"
#include "chrome/browser/google_apis/drive_api_parser.h"
diff --git a/chrome/browser/google_apis/drive_api_requests.h b/chrome/browser/google_apis/drive_api_requests.h
index ae75915..f660fc6 100644
--- a/chrome/browser/google_apis/drive_api_requests.h
+++ b/chrome/browser/google_apis/drive_api_requests.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/callback_forward.h"
+#include "base/time/time.h"
#include "chrome/browser/google_apis/base_requests.h"
#include "chrome/browser/google_apis/drive_api_url_generator.h"
#include "chrome/browser/google_apis/drive_common_callbacks.h"
diff --git a/chrome/browser/google_apis/gdata_contacts_requests.h b/chrome/browser/google_apis/gdata_contacts_requests.h
index 67861e3..ee36024 100644
--- a/chrome/browser/google_apis/gdata_contacts_requests.h
+++ b/chrome/browser/google_apis/gdata_contacts_requests.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/time/time.h"
#include "chrome/browser/google_apis/base_requests.h"
namespace google_apis {
diff --git a/chrome/browser/google_apis/gdata_wapi_requests.cc b/chrome/browser/google_apis/gdata_wapi_requests.cc
index 0857a42..e0b305f 100644
--- a/chrome/browser/google_apis/gdata_wapi_requests.cc
+++ b/chrome/browser/google_apis/gdata_wapi_requests.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/google_apis/gdata_wapi_requests.h"
#include "base/location.h"
+#include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h"
#include "base/values.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
diff --git a/chrome/browser/google_apis/request_sender.cc b/chrome/browser/google_apis/request_sender.cc
index 0c06c18..8c494cb 100644
--- a/chrome/browser/google_apis/request_sender.cc
+++ b/chrome/browser/google_apis/request_sender.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/google_apis/request_sender.h"
#include "base/bind.h"
+#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/base_requests.h"
@@ -15,7 +16,7 @@ namespace google_apis {
RequestSender::RequestSender(
AuthServiceInterface* auth_service,
net::URLRequestContextGetter* url_request_context_getter,
- base::TaskRunner* blocking_task_runner,
+ base::SequencedTaskRunner* blocking_task_runner,
const std::string& custom_user_agent)
: auth_service_(auth_service),
url_request_context_getter_(url_request_context_getter),
diff --git a/chrome/browser/google_apis/request_sender.h b/chrome/browser/google_apis/request_sender.h
index f37754c..9bf8e91 100644
--- a/chrome/browser/google_apis/request_sender.h
+++ b/chrome/browser/google_apis/request_sender.h
@@ -17,7 +17,7 @@
#include "chrome/browser/google_apis/gdata_errorcode.h"
namespace base {
-class TaskRunner;
+class SequencedTaskRunner;
}
namespace net {
@@ -46,7 +46,7 @@ class RequestSender {
// requests issued through the request sender if the value is not empty.
RequestSender(AuthServiceInterface* auth_service,
net::URLRequestContextGetter* url_request_context_getter,
- base::TaskRunner* blocking_task_runner,
+ base::SequencedTaskRunner* blocking_task_runner,
const std::string& custom_user_agent);
~RequestSender();
@@ -56,7 +56,7 @@ class RequestSender {
return url_request_context_getter_;
}
- base::TaskRunner* blocking_task_runner() const {
+ base::SequencedTaskRunner* blocking_task_runner() const {
return blocking_task_runner_.get();
}
@@ -92,7 +92,7 @@ class RequestSender {
scoped_ptr<AuthServiceInterface> auth_service_;
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
- scoped_refptr<base::TaskRunner> blocking_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
std::set<AuthenticatedRequestInterface*> in_flight_requests_;
const std::string custom_user_agent_;
diff --git a/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc b/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc
index 4c5525e..773a992 100644
--- a/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc
+++ b/chrome/browser/sync_file_system/drive_backend_v1/api_util.cc
@@ -10,6 +10,7 @@
#include <string>
#include "base/file_util.h"
+#include "base/sequenced_task_runner.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -171,11 +172,15 @@ APIUtil::APIUtil(Profile* profile,
temp_dir_path_(temp_dir_path) {
ProfileOAuth2TokenService* oauth_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ base::SequencedWorkerPool* blocking_pool =
+ content::BrowserThread::GetBlockingPool();
+ scoped_refptr<base::SequencedTaskRunner> task_runner(
+ blocking_pool->GetSequencedTaskRunner(blocking_pool->GetSequenceToken()));
if (IsDriveAPIDisabled()) {
drive_service_.reset(new drive::GDataWapiService(
oauth_service,
profile->GetRequestContext(),
- content::BrowserThread::GetBlockingPool(),
+ task_runner.get(),
GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction),
GURL(google_apis::GDataWapiUrlGenerator::kBaseDownloadUrlForProduction),
std::string() /* custom_user_agent */));
@@ -183,7 +188,7 @@ APIUtil::APIUtil(Profile* profile,
drive_service_.reset(new drive::DriveAPIService(
oauth_service,
profile->GetRequestContext(),
- content::BrowserThread::GetBlockingPool(),
+ task_runner.get(),
GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction),
GURL(google_apis::DriveApiUrlGenerator::kBaseDownloadUrlForProduction),
GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction),
diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc
index 27fb929..eb8bfd7 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc
@@ -87,7 +87,8 @@ SyncFileSystemServiceFactory::BuildServiceInstanceFor(
new drive::DriveAPIService(
token_service,
context->GetRequestContext(),
- worker_pool.get(),
+ worker_pool->GetSequencedTaskRunner(
+ worker_pool->GetSequenceToken()).get(),
base_drive_url, base_download_url, wapi_base_url,
std::string() /* custom_user_agent */));
drive_service->Initialize(token_service->GetPrimaryAccountId());
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.h b/chrome/service/cloud_print/cloud_print_url_fetcher.h
index a71a8da..d0ade54 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher.h
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/time/time.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
diff --git a/net/url_request/test_url_fetcher_factory.cc b/net/url_request/test_url_fetcher_factory.cc
index c95e07d..5a72d71 100644
--- a/net/url_request/test_url_fetcher_factory.cc
+++ b/net/url_request/test_url_fetcher_factory.cc
@@ -142,11 +142,11 @@ void TestURLFetcher::SetAutomaticallyRetryOnNetworkChanges(int max_retries) {
void TestURLFetcher::SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner) {
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
}
void TestURLFetcher::SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner) {
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
}
void TestURLFetcher::SaveResponseWithWriter(
diff --git a/net/url_request/test_url_fetcher_factory.h b/net/url_request/test_url_fetcher_factory.h
index ff46dba..75ffcad 100644
--- a/net/url_request/test_url_fetcher_factory.h
+++ b/net/url_request/test_url_fetcher_factory.h
@@ -124,9 +124,9 @@ class TestURLFetcher : public URLFetcher {
virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) OVERRIDE;
virtual void SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
virtual void SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
virtual void SaveResponseWithWriter(
scoped_ptr<URLFetcherResponseWriter> response_writer) OVERRIDE;
virtual HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
diff --git a/net/url_request/url_fetcher.h b/net/url_request/url_fetcher.h
index 1de8bad..4cc6f5f 100644
--- a/net/url_request/url_fetcher.h
+++ b/net/url_request/url_fetcher.h
@@ -12,7 +12,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/supports_user_data.h"
-#include "base/task_runner.h"
#include "net/base/net_export.h"
class GURL;
@@ -20,6 +19,8 @@ class GURL;
namespace base {
class FilePath;
class MessageLoopProxy;
+class SequencedTaskRunner;
+class TaskRunner;
class TimeDelta;
}
@@ -231,7 +232,7 @@ class NET_EXPORT URLFetcher {
// take ownership by calling GetResponseAsFilePath().
virtual void SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner) = 0;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) = 0;
// By default, the response is saved in a string. Call this method to save the
// response to a temporary file instead. Must be called before Start().
@@ -239,7 +240,7 @@ class NET_EXPORT URLFetcher {
// The created file is removed when the URLFetcher is deleted unless you
// take ownership by calling GetResponseAsFilePath().
virtual void SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner) = 0;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) = 0;
// By default, the response is saved in a string. Call this method to use the
// specified writer to save the response. Must be called before Start().
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index f4e1113..708429f 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/thread_task_runner_handle.h"
@@ -266,14 +267,14 @@ void URLFetcherCore::SetAutomaticallyRetryOnNetworkChanges(int max_retries) {
void URLFetcherCore::SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner) {
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
SaveResponseWithWriter(scoped_ptr<URLFetcherResponseWriter>(
new URLFetcherFileWriter(file_task_runner, file_path)));
}
void URLFetcherCore::SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner) {
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
SaveResponseWithWriter(scoped_ptr<URLFetcherResponseWriter>(
new URLFetcherFileWriter(file_task_runner, base::FilePath())));
diff --git a/net/url_request/url_fetcher_core.h b/net/url_request/url_fetcher_core.h
index 9ee58b6..c8864d4 100644
--- a/net/url_request/url_fetcher_core.h
+++ b/net/url_request/url_fetcher_core.h
@@ -97,9 +97,9 @@ class URLFetcherCore
void SetAutomaticallyRetryOnNetworkChanges(int max_retries);
void SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner);
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner);
void SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner);
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner);
void SaveResponseWithWriter(
scoped_ptr<URLFetcherResponseWriter> response_writer);
HttpResponseHeaders* GetResponseHeaders() const;
diff --git a/net/url_request/url_fetcher_impl.cc b/net/url_request/url_fetcher_impl.cc
index c3fc646..32253c9 100644
--- a/net/url_request/url_fetcher_impl.cc
+++ b/net/url_request/url_fetcher_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/sequenced_task_runner.h"
#include "net/url_request/url_fetcher_core.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_fetcher_response_writer.h"
@@ -121,12 +122,12 @@ void URLFetcherImpl::SetAutomaticallyRetryOnNetworkChanges(int max_retries) {
void URLFetcherImpl::SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner) {
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
core_->SaveResponseToFileAtPath(file_path, file_task_runner);
}
void URLFetcherImpl::SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner) {
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) {
core_->SaveResponseToTemporaryFile(file_task_runner);
}
diff --git a/net/url_request/url_fetcher_impl.h b/net/url_request/url_fetcher_impl.h
index ec72d1a..fe0362b 100644
--- a/net/url_request/url_fetcher_impl.h
+++ b/net/url_request/url_fetcher_impl.h
@@ -70,9 +70,9 @@ class NET_EXPORT_PRIVATE URLFetcherImpl : public URLFetcher {
virtual void SetAutomaticallyRetryOnNetworkChanges(int max_retries) OVERRIDE;
virtual void SaveResponseToFileAtPath(
const base::FilePath& file_path,
- scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
virtual void SaveResponseToTemporaryFile(
- scoped_refptr<base::TaskRunner> file_task_runner) OVERRIDE;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner) OVERRIDE;
virtual void SaveResponseWithWriter(
scoped_ptr<URLFetcherResponseWriter> response_writer) OVERRIDE;
virtual HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
diff --git a/net/url_request/url_fetcher_response_writer.cc b/net/url_request/url_fetcher_response_writer.cc
index ee52578..fd08a8d 100644
--- a/net/url_request/url_fetcher_response_writer.cc
+++ b/net/url_request/url_fetcher_response_writer.cc
@@ -6,7 +6,7 @@
#include "base/file_util.h"
#include "base/location.h"
-#include "base/task_runner.h"
+#include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h"
#include "net/base/file_stream.h"
#include "net/base/io_buffer.h"
@@ -50,7 +50,7 @@ URLFetcherStringWriter* URLFetcherStringWriter::AsStringWriter() {
}
URLFetcherFileWriter::URLFetcherFileWriter(
- scoped_refptr<base::TaskRunner> file_task_runner,
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner,
const base::FilePath& file_path)
: weak_factory_(this),
file_task_runner_(file_task_runner),
diff --git a/net/url_request/url_fetcher_response_writer.h b/net/url_request/url_fetcher_response_writer.h
index 0032a4a..422a8a4 100644
--- a/net/url_request/url_fetcher_response_writer.h
+++ b/net/url_request/url_fetcher_response_writer.h
@@ -14,7 +14,7 @@
#include "net/base/net_export.h"
namespace base {
-class TaskRunner;
+class SequencedTaskRunner;
} // namespace base
namespace net {
@@ -81,8 +81,9 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter {
public:
// |file_path| is used as the destination path. If |file_path| is empty,
// Initialize() will create a temporary file.
- URLFetcherFileWriter(scoped_refptr<base::TaskRunner> file_task_runner,
- const base::FilePath& file_path);
+ URLFetcherFileWriter(
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner,
+ const base::FilePath& file_path);
virtual ~URLFetcherFileWriter();
const base::FilePath& file_path() const { return file_path_; }
@@ -122,7 +123,7 @@ class NET_EXPORT URLFetcherFileWriter : public URLFetcherResponseWriter {
base::WeakPtrFactory<URLFetcherFileWriter> weak_factory_;
// Task runner on which file operations should happen.
- scoped_refptr<base::TaskRunner> file_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
// Destination file path.
// Initialize() creates a temporary file if this variable is empty.