Index: net/url_request/url_fetcher_impl_unittest.cc |
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc |
index 6435baf3d7639289d9ad13e48ce61d2be5f77d5b..d97d04ff6dffafda4eed1a2085acf7e26ad6a7c0 100644 |
--- a/net/url_request/url_fetcher_impl_unittest.cc |
+++ b/net/url_request/url_fetcher_impl_unittest.cc |
@@ -136,7 +136,7 @@ class URLFetcherTest : public testing::Test, |
void URLFetcherTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
fetcher_->Start(); |
} |
@@ -346,7 +346,7 @@ class CancelTestURLRequestContextGetter |
context_->throttler_manager(), |
"", 200, 3, 2000, 2.0, 0.0, 4000)); |
context_->throttler_manager()->OverrideEntryForTests( |
- throttle_for_url_, entry); |
+ throttle_for_url_, entry.get()); |
context_created_.Signal(); |
} |
@@ -406,7 +406,7 @@ class URLFetcherFileTest : public URLFetcherTest { |
void URLFetcherPostTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::POST, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
fetcher_->SetUploadData("application/x-www-form-urlencoded", |
"bobsyeruncle"); |
fetcher_->Start(); |
@@ -443,7 +443,7 @@ void URLFetcherEmptyPostTest::OnURLFetchComplete(const URLFetcher* source) { |
void URLFetcherDownloadProgressTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
previous_progress_ = 0; |
fetcher_->Start(); |
} |
@@ -461,7 +461,7 @@ void URLFetcherDownloadProgressTest::OnURLFetchDownloadProgress( |
void URLFetcherDownloadProgressCancelTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
cancelled_ = false; |
fetcher_->Start(); |
} |
@@ -485,7 +485,7 @@ void URLFetcherDownloadProgressCancelTest::OnURLFetchComplete( |
void URLFetcherUploadProgressTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::POST, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
previous_progress_ = 0; |
// Large enough data to require more than one read from UploadDataStream. |
chunk_.assign(1<<16, 'a'); |
@@ -542,7 +542,7 @@ URLFetcherStopOnRedirectTest::~URLFetcherStopOnRedirectTest() { |
void URLFetcherStopOnRedirectTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
fetcher_->SetStopOnRedirect(true); |
fetcher_->Start(); |
} |
@@ -560,7 +560,7 @@ void URLFetcherStopOnRedirectTest::OnURLFetchComplete( |
void URLFetcherProtectTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
start_time_ = Time::Now(); |
fetcher_->SetMaxRetries(11); |
fetcher_->Start(); |
@@ -584,7 +584,7 @@ void URLFetcherProtectTest::OnURLFetchComplete(const URLFetcher* source) { |
if (count < 20) { |
fetcher_->SetRequestContext( |
new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
fetcher_->Start(); |
} else { |
// We have already sent 20 requests continuously. And we expect that |
@@ -598,7 +598,7 @@ void URLFetcherProtectTest::OnURLFetchComplete(const URLFetcher* source) { |
void URLFetcherProtectTestPassedThrough::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
fetcher_->SetAutomaticallyRetryOn5xx(false); |
start_time_ = Time::Now(); |
fetcher_->SetMaxRetries(11); |
@@ -657,7 +657,7 @@ void URLFetcherBadHTTPSTest::OnURLFetchComplete( |
void URLFetcherCancelTest::CreateFetcher(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
CancelTestURLRequestContextGetter* context_getter = |
- new CancelTestURLRequestContextGetter(io_message_loop_proxy(), |
+ new CancelTestURLRequestContextGetter(io_message_loop_proxy().get(), |
url); |
fetcher_->SetRequestContext(context_getter); |
fetcher_->SetMaxRetries(2); |
@@ -692,7 +692,7 @@ void URLFetcherMultipleAttemptTest::OnURLFetchComplete( |
if (!data.empty() && data_.empty()) { |
data_ = data; |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
fetcher_->Start(); |
} else { |
EXPECT_EQ(data, data_); |
@@ -704,7 +704,7 @@ void URLFetcherFileTest::CreateFetcherForFile(const GURL& url, |
const FilePath& file_path) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
// Use the IO message loop to do the file operations in this test. |
fetcher_->SaveResponseToFileAtPath(file_path, io_message_loop_proxy()); |
@@ -714,7 +714,7 @@ void URLFetcherFileTest::CreateFetcherForFile(const GURL& url, |
void URLFetcherFileTest::CreateFetcherForTempFile(const GURL& url) { |
fetcher_ = new URLFetcherImpl(url, URLFetcher::GET, this); |
fetcher_->SetRequestContext(new ThrottlingTestURLRequestContextGetter( |
- io_message_loop_proxy(), request_context())); |
+ io_message_loop_proxy().get(), request_context())); |
// Use the IO message loop to do the file operations in this test. |
fetcher_->SaveResponseToTemporaryFile(io_message_loop_proxy()); |
@@ -930,7 +930,8 @@ TEST_F(URLFetcherProtectTest, Overload) { |
new URLRequestThrottlerEntry( |
request_context()->throttler_manager(), |
"", 200, 3, 1, 2.0, 0.0, 256)); |
- request_context()->throttler_manager()->OverrideEntryForTests(url, entry); |
+ request_context()->throttler_manager()-> |
+ OverrideEntryForTests(url, entry.get()); |
CreateFetcher(url); |
@@ -953,7 +954,8 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) { |
new URLRequestThrottlerEntry( |
request_context()->throttler_manager(), |
"", 200, 3, 1, 2.0, 0.0, 256)); |
- request_context()->throttler_manager()->OverrideEntryForTests(url, entry); |
+ request_context()->throttler_manager()-> |
+ OverrideEntryForTests(url, entry.get()); |
CreateFetcher(url); |
@@ -978,7 +980,8 @@ TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) { |
"", 200, 3, 100, 2.0, 0.0, 150000)); |
// Total time if *not* for not doing automatic backoff would be 150s. |
// In reality it should be "as soon as server responds". |
- request_context()->throttler_manager()->OverrideEntryForTests(url, entry); |
+ request_context()->throttler_manager()-> |
+ OverrideEntryForTests(url, entry.get()); |
CreateFetcher(url); |
@@ -1045,7 +1048,8 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) { |
new URLRequestThrottlerEntry( |
request_context()->throttler_manager(), |
"", 4000, 1, 2000, 2.0, 0.0, 4000)); |
- request_context()->throttler_manager()->OverrideEntryForTests(url, entry); |
+ request_context()->throttler_manager()-> |
+ OverrideEntryForTests(url, entry.get()); |
// Fake that a request has just started. |
entry->ReserveSendingTimeForNextRequest(base::TimeTicks()); |