| Index: content/common/net/url_fetcher_impl_unittest.cc
|
| diff --git a/content/common/net/url_fetcher_impl_unittest.cc b/content/common/net/url_fetcher_impl_unittest.cc
|
| index 909bb6f0247c24a93797f79b0b55c9c8feb1e940..acd275310a0ce3f64d2840780c3542eb0b91216e 100644
|
| --- a/content/common/net/url_fetcher_impl_unittest.cc
|
| +++ b/content/common/net/url_fetcher_impl_unittest.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/synchronization/waitable_event.h"
|
| #include "base/threading/thread.h"
|
| #include "build/build_config.h"
|
| +#include "content/public/common/content_url_request_user_data.h"
|
| #include "content/public/common/url_fetcher_delegate.h"
|
| #include "crypto/nss_util.h"
|
| #include "net/http/http_response_headers.h"
|
| @@ -109,6 +110,8 @@ void URLFetcherTest::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::GET, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| fetcher_->Start();
|
| }
|
|
|
| @@ -299,6 +302,8 @@ void URLFetcherTempFileTest::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::GET, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
|
|
| // Use the IO message loop to do the file operations in this test.
|
| fetcher_->SaveResponseToTemporaryFile(io_message_loop_proxy());
|
| @@ -362,6 +367,8 @@ void URLFetcherPostTest::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::POST, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| fetcher_->SetUploadData("application/x-www-form-urlencoded",
|
| "bobsyeruncle");
|
| fetcher_->Start();
|
| @@ -378,6 +385,8 @@ void URLFetcherDownloadProgressTest::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::GET, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| previous_progress_ = 0;
|
| fetcher_->Start();
|
| }
|
| @@ -396,6 +405,8 @@ void URLFetcherDownloadProgressCancelTest::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::GET, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| cancelled_ = false;
|
| fetcher_->Start();
|
| }
|
| @@ -438,6 +449,8 @@ void URLFetcherProtectTest::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::GET, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| start_time_ = Time::Now();
|
| fetcher_->SetMaxRetries(11);
|
| fetcher_->Start();
|
| @@ -461,8 +474,9 @@ void URLFetcherProtectTest::OnURLFetchComplete(
|
| static int count = 0;
|
| count++;
|
| if (count < 20) {
|
| - fetcher_->StartWithRequestContextGetter(new TestURLRequestContextGetter(
|
| - io_message_loop_proxy()));
|
| + fetcher_->StartWithRequestContextGetterAndUserData(
|
| + new TestURLRequestContextGetter(io_message_loop_proxy()),
|
| + new content::ContentURLRequestUserData());
|
| } else {
|
| // We have already sent 20 requests continuously. And we expect that
|
| // it takes more than 1 second due to the overload protection settings.
|
| @@ -476,6 +490,8 @@ void URLFetcherProtectTestPassedThrough::CreateFetcher(const GURL& url) {
|
| fetcher_ = new URLFetcherImpl(url, content::URLFetcher::GET, this);
|
| fetcher_->SetRequestContext(new TestURLRequestContextGetter(
|
| io_message_loop_proxy()));
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| fetcher_->SetAutomaticallyRetryOn5xx(false);
|
| start_time_ = Time::Now();
|
| fetcher_->SetMaxRetries(11);
|
| @@ -540,6 +556,8 @@ void URLFetcherCancelTest::CreateFetcher(const GURL& url) {
|
| CancelTestURLRequestContextGetter* context_getter =
|
| new CancelTestURLRequestContextGetter(io_message_loop_proxy());
|
| fetcher_->SetRequestContext(context_getter);
|
| + fetcher_->SetContentURLRequestUserData(
|
| + new content::ContentURLRequestUserData());
|
| fetcher_->SetMaxRetries(2);
|
| fetcher_->Start();
|
| // We need to wait for the creation of the net::URLRequestContext, since we
|
| @@ -572,8 +590,9 @@ void URLFetcherMultipleAttemptTest::OnURLFetchComplete(
|
| EXPECT_FALSE(data.empty());
|
| if (!data.empty() && data_.empty()) {
|
| data_ = data;
|
| - fetcher_->StartWithRequestContextGetter(
|
| - new TestURLRequestContextGetter(io_message_loop_proxy()));
|
| + fetcher_->StartWithRequestContextGetterAndUserData(
|
| + new TestURLRequestContextGetter(io_message_loop_proxy()),
|
| + new content::ContentURLRequestUserData());
|
| } else {
|
| EXPECT_EQ(data, data_);
|
| delete fetcher_; // Have to delete this here and not in the destructor,
|
|
|