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

Side by Side Diff: content/browser/appcache/appcache_storage_impl_unittest.cc

Issue 1295523006: Using scoped_ptr for URLRequestJobFactoryImpl::SetProtocolHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stack> 5 #include <stack>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ~IOThread() override { Stop(); } 156 ~IOThread() override { Stop(); }
157 157
158 net::URLRequestContext* request_context() { 158 net::URLRequestContext* request_context() {
159 return request_context_.get(); 159 return request_context_.get();
160 } 160 }
161 161
162 void Init() override { 162 void Init() override {
163 scoped_ptr<net::URLRequestJobFactoryImpl> factory( 163 scoped_ptr<net::URLRequestJobFactoryImpl> factory(
164 new net::URLRequestJobFactoryImpl()); 164 new net::URLRequestJobFactoryImpl());
165 factory->SetProtocolHandler( 165 factory->SetProtocolHandler(
166 "http", 166 "http", make_scoped_ptr(new MockHttpServerJobFactory(
167 new MockHttpServerJobFactory( 167 make_scoped_ptr(new AppCacheInterceptor()))));
168 make_scoped_ptr(new AppCacheInterceptor())));
169 job_factory_ = factory.Pass(); 168 job_factory_ = factory.Pass();
170 request_context_.reset(new net::TestURLRequestContext()); 169 request_context_.reset(new net::TestURLRequestContext());
171 request_context_->set_job_factory(job_factory_.get()); 170 request_context_->set_job_factory(job_factory_.get());
172 } 171 }
173 172
174 void CleanUp() override { 173 void CleanUp() override {
175 request_context_.reset(); 174 request_context_.reset();
176 job_factory_.reset(); 175 job_factory_.reset();
177 } 176 }
178 177
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); 2020 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2);
2022 } 2021 }
2023 2022
2024 TEST_F(AppCacheStorageImplTest, Reinitialize3) { 2023 TEST_F(AppCacheStorageImplTest, Reinitialize3) {
2025 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); 2024 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3);
2026 } 2025 }
2027 2026
2028 // That's all folks! 2027 // That's all folks!
2029 2028
2030 } // namespace content 2029 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698