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

Side by Side Diff: ios/web/shell/shell_url_request_context_getter.cc

Issue 1295523006: Using scoped_ptr for URLRequestJobFactoryImpl::SetProtocolHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing un-modified file 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 "ios/web/shell/shell_url_request_context_getter.h" 5 #include "ios/web/shell/shell_url_request_context_getter.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 new net::HttpCache::DefaultBackend(net::DISK_CACHE, 134 new net::HttpCache::DefaultBackend(net::DISK_CACHE,
135 net::CACHE_BACKEND_DEFAULT, 135 net::CACHE_BACKEND_DEFAULT,
136 cache_path, 0, cache_task_runner_); 136 cache_path, 0, cache_task_runner_);
137 137
138 net::HttpCache* main_cache = 138 net::HttpCache* main_cache =
139 new net::HttpCache(network_session_params, main_backend); 139 new net::HttpCache(network_session_params, main_backend);
140 storage_->set_http_transaction_factory(main_cache); 140 storage_->set_http_transaction_factory(main_cache);
141 141
142 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( 142 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
143 new net::URLRequestJobFactoryImpl()); 143 new net::URLRequestJobFactoryImpl());
144 bool set_protocol = 144 bool set_protocol = job_factory->SetProtocolHandler(
145 job_factory->SetProtocolHandler("data", new net::DataProtocolHandler); 145 "data", make_scoped_ptr(new net::DataProtocolHandler));
146 DCHECK(set_protocol); 146 DCHECK(set_protocol);
147 147
148 storage_->set_job_factory(job_factory.release()); 148 storage_->set_job_factory(job_factory.release());
149 } 149 }
150 150
151 return url_request_context_.get(); 151 return url_request_context_.get();
152 } 152 }
153 153
154 scoped_refptr<base::SingleThreadTaskRunner> 154 scoped_refptr<base::SingleThreadTaskRunner>
155 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 155 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
156 return network_task_runner_; 156 return network_task_runner_;
157 } 157 }
158 158
159 } // namespace web 159 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/net/request_tracker_impl_unittest.mm ('k') | ios/web/webui/url_data_manager_ios_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698