OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 base::FilePath cookie_path; | 70 base::FilePath cookie_path; |
71 bool cookie_path_found = PathService::Get(base::DIR_APP_DATA, &cookie_path); | 71 bool cookie_path_found = PathService::Get(base::DIR_APP_DATA, &cookie_path); |
72 DCHECK(cookie_path_found); | 72 DCHECK(cookie_path_found); |
73 cookie_path = cookie_path.Append("WebShell").Append("Cookies"); | 73 cookie_path = cookie_path.Append("WebShell").Append("Cookies"); |
74 scoped_refptr<net::CookieMonster::PersistentCookieStore> persistent_store = | 74 scoped_refptr<net::CookieMonster::PersistentCookieStore> persistent_store = |
75 new net::SQLitePersistentCookieStore( | 75 new net::SQLitePersistentCookieStore( |
76 cookie_path, network_task_runner_, | 76 cookie_path, network_task_runner_, |
77 web::WebThread::GetBlockingPool()->GetSequencedTaskRunner( | 77 web::WebThread::GetBlockingPool()->GetSequencedTaskRunner( |
78 web::WebThread::GetBlockingPool()->GetSequenceToken()), | 78 web::WebThread::GetBlockingPool()->GetSequenceToken()), |
79 true, nullptr); | 79 true, nullptr); |
80 scoped_refptr<net::CookieStoreIOS> cookie_store = | 80 scoped_ptr<net::CookieStoreIOS> cookie_store( |
81 new net::CookieStoreIOS(persistent_store.get()); | 81 new net::CookieStoreIOS(persistent_store.get())); |
82 storage_->set_cookie_store(cookie_store.get()); | |
83 net::CookieStoreIOS::SwitchSynchronizedStore(nullptr, cookie_store.get()); | 82 net::CookieStoreIOS::SwitchSynchronizedStore(nullptr, cookie_store.get()); |
| 83 storage_->set_cookie_store(std::move(cookie_store)); |
84 | 84 |
85 std::string user_agent = web::GetWebClient()->GetUserAgent(false); | 85 std::string user_agent = web::GetWebClient()->GetUserAgent(false); |
86 storage_->set_http_user_agent_settings(make_scoped_ptr( | 86 storage_->set_http_user_agent_settings(make_scoped_ptr( |
87 new net::StaticHttpUserAgentSettings("en-us,en", user_agent))); | 87 new net::StaticHttpUserAgentSettings("en-us,en", user_agent))); |
88 storage_->set_proxy_service( | 88 storage_->set_proxy_service( |
89 net::ProxyService::CreateUsingSystemProxyResolver( | 89 net::ProxyService::CreateUsingSystemProxyResolver( |
90 std::move(proxy_config_service_), 0, | 90 std::move(proxy_config_service_), 0, |
91 url_request_context_->net_log())); | 91 url_request_context_->net_log())); |
92 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); | 92 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); |
93 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); | 93 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 return url_request_context_.get(); | 154 return url_request_context_.get(); |
155 } | 155 } |
156 | 156 |
157 scoped_refptr<base::SingleThreadTaskRunner> | 157 scoped_refptr<base::SingleThreadTaskRunner> |
158 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { | 158 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { |
159 return network_task_runner_; | 159 return network_task_runner_; |
160 } | 160 } |
161 | 161 |
162 } // namespace web | 162 } // namespace web |
OLD | NEW |