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

Unified Diff: content/browser/appcache/appcache_request_handler_unittest.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: fixes Created 3 years, 8 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
Index: content/browser/appcache/appcache_request_handler_unittest.cc
diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc
index a570f1756247273ba9941ba1325e661860de7dce..a74f520a593edac6d1147e55632e565117130e14 100644
--- a/content/browser/appcache/appcache_request_handler_unittest.cc
+++ b/content/browser/appcache/appcache_request_handler_unittest.cc
@@ -278,9 +278,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
@@ -326,9 +325,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
mock_storage()->SimulateFindMainResource(
@@ -376,9 +374,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
mock_storage()->SimulateFindMainResource(
@@ -459,9 +456,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ =
empty_context_->CreateRequest(GURL("http://blah/fallback-override"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
mock_storage()->SimulateFindMainResource(
@@ -524,9 +520,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
void SubResource_Miss_WithNoCacheSelected() {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
// We avoid creating handler when possible, sub-resource requests are not
// subject to retrieval from an appcache when there's no associated cache.
@@ -544,9 +539,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
@@ -576,9 +570,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
request_.get(), request_->context()->network_delegate()));
@@ -611,9 +604,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
request_.get(), request_->context()->network_delegate()));
@@ -644,9 +636,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
request_.get(), request_->context()->network_delegate()));
@@ -678,9 +669,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
request_.get(), request_->context()->network_delegate()));
@@ -713,9 +703,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
request_.get(), request_->context()->network_delegate()));
@@ -743,9 +732,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
backend_impl_->UnregisterHost(1);
@@ -771,9 +759,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
@@ -807,9 +794,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
request_.get(), request_->context()->network_delegate()));
@@ -837,9 +823,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
void DestroyedServiceWithCrossSiteNav() {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
handler_->PrepareForCrossSiteTransfer(backend_impl_->process_id());
EXPECT_TRUE(handler_->host_for_cross_site_transfer_.get());
@@ -871,9 +856,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("ftp://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_SUB_RESOURCE,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_SUB_RESOURCE, false);
EXPECT_TRUE(handler_.get()); // we could redirect to http (conceivably)
EXPECT_FALSE(handler_->MaybeLoadResource(
@@ -893,9 +877,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
void CanceledRequest() {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
job_.reset(handler_->MaybeLoadResource(
@@ -943,8 +926,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
backend_impl_->RegisterHost(kWorkerHostId);
AppCacheHost* worker_host = backend_impl_->GetHost(kWorkerHostId);
worker_host->SelectCacheForWorker(kParentHostId, kMockProcessId);
- handler_.reset(worker_host->CreateRequestHandler(
- request_.get(), RESOURCE_TYPE_SHARED_WORKER, false));
+ handler_ = worker_host->CreateRequestHandler(
+ request_.get(), RESOURCE_TYPE_SHARED_WORKER, false);
EXPECT_TRUE(handler_.get());
// Verify that the handler is associated with the parent host.
EXPECT_EQ(host_, handler_->host_);
@@ -956,8 +939,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
worker_host = backend_impl_->GetHost(kAbandonedWorkerHostId);
EXPECT_EQ(NULL, backend_impl_->GetHost(kNonExsitingHostId));
worker_host->SelectCacheForWorker(kNonExsitingHostId, kMockProcessId);
- handler_.reset(worker_host->CreateRequestHandler(
- request_.get(), RESOURCE_TYPE_SHARED_WORKER, false));
+ handler_ = worker_host->CreateRequestHandler(
+ request_.get(), RESOURCE_TYPE_SHARED_WORKER, false);
EXPECT_FALSE(handler_.get());
TestFinished();
@@ -972,9 +955,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
request_ = empty_context_->CreateRequest(GURL("http://blah/"),
net::DEFAULT_PRIORITY, &delegate_);
- handler_.reset(host_->CreateRequestHandler(request_.get(),
- RESOURCE_TYPE_MAIN_FRAME,
- false));
+ handler_ = host_->CreateRequestHandler(request_.get(),
+ RESOURCE_TYPE_MAIN_FRAME, false);
EXPECT_TRUE(handler_.get());
mock_policy_->can_load_return_value_ = false;

Powered by Google App Engine
This is Rietveld 408576698