Index: net/url_request/url_request_unittest.cc |
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc |
index 1cb0aa62d15b49382ab6f48048aa72c6d4c99c51..f3828dc8a3f4b779f4e52ac70c5fecd7a12e7209 100644 |
--- a/net/url_request/url_request_unittest.cc |
+++ b/net/url_request/url_request_unittest.cc |
@@ -89,7 +89,7 @@ void FillBuffer(char* buffer, size_t len) { |
} |
scoped_refptr<net::UploadData> CreateSimpleUploadData(const char* data) { |
- scoped_refptr<net::UploadData> upload = new net::UploadData; |
+ scoped_refptr<net::UploadData> upload(new net::UploadData); |
upload->AppendBytes(data, strlen(data)); |
return upload; |
} |
@@ -146,7 +146,7 @@ class URLRequestTestHTTP : public URLRequestTest { |
} |
uploadBytes[kMsgSize] = '\0'; |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
for (int i = 0; i < kIterations; ++i) { |
TestDelegate d; |
@@ -527,7 +527,7 @@ TEST_F(URLRequestTestHTTP, CancelTest4) { |
TEST_F(URLRequestTestHTTP, CancelTest5) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
// populate cache |
{ |
@@ -1134,7 +1134,7 @@ TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) { |
TEST_F(URLRequestTestHTTP, VaryHeader) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
// populate the cache |
{ |
@@ -1180,7 +1180,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) { |
TEST_F(URLRequestTestHTTP, BasicAuth) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
// populate the cache |
{ |
@@ -1230,7 +1230,7 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) { |
// Request a page that will give a 401 containing a Set-Cookie header. |
// Verify that when the transaction is restarted, it includes the new cookie. |
{ |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
TestDelegate d; |
d.set_username(kUser); |
d.set_password(kSecret); |
@@ -1251,7 +1251,7 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) { |
// Same test as above, except this time the restart is initiated earlier |
// (without user intervention since identity is embedded in the URL). |
{ |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
TestDelegate d; |
GURL::Replacements replacements; |
@@ -1279,7 +1279,7 @@ TEST_F(URLRequestTest, DoNotSendCookies) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
// Set up a cookie. |
{ |
@@ -1328,7 +1328,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext()); |
// Set up a cookie. |
{ |
@@ -1384,7 +1384,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
// Set up a cookie. |
{ |
@@ -1438,7 +1438,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
// Set up a cookie. |
{ |
@@ -1495,7 +1495,7 @@ TEST_F(URLRequestTest, DoNotSaveEmptyCookies) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
// Set up an empty cookie. |
{ |
@@ -1515,7 +1515,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
// Set up a cookie. |
{ |
@@ -1570,7 +1570,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
// Set up a cookie. |
{ |
@@ -1627,7 +1627,7 @@ TEST_F(URLRequestTest, CancelTest_During_CookiePolicy) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
TestCookiePolicy cookie_policy(TestCookiePolicy::ASYNC); |
context->set_cookie_policy(&cookie_policy); |
@@ -1658,7 +1658,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnGetCookies) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
TestCookiePolicy cookie_policy(TestCookiePolicy::NO_GET_COOKIES); |
context->set_cookie_policy(&cookie_policy); |
@@ -1687,7 +1687,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnSetCookie) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
TestCookiePolicy cookie_policy(TestCookiePolicy::NO_SET_COOKIE); |
context->set_cookie_policy(&cookie_policy); |
@@ -1721,7 +1721,7 @@ TEST_F(URLRequestTest, CookiePolicy_ForceSession) { |
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath()); |
ASSERT_TRUE(test_server.Start()); |
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); |
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext()); |
TestCookiePolicy cookie_policy(TestCookiePolicy::FORCE_SESSION); |
context->set_cookie_policy(&cookie_policy); |