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

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

Issue 2649083002: Divide CookieStoreIOS into two different classes with different backends (Closed)
Patch Set: Eugene's comments Created 3 years, 11 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "base/threading/worker_pool.h" 15 #include "base/threading/worker_pool.h"
16 #import "ios/net/cookies/cookie_store_ios.h" 16 #import "ios/net/cookies/cookie_store_ios.h"
Eugene But (OOO till 7-30) 2017/01/24 22:31:30 nit: do we still need this include?
maksims (do not use this acc) 2017/01/27 12:46:37 Done.
17 #import "ios/net/cookies/cookie_store_ios_persistent.h"
17 #import "ios/web/public/web_client.h" 18 #import "ios/web/public/web_client.h"
18 #include "ios/web/public/web_thread.h" 19 #include "ios/web/public/web_thread.h"
19 #include "ios/web/shell/shell_network_delegate.h" 20 #include "ios/web/shell/shell_network_delegate.h"
20 #include "net/base/cache_type.h" 21 #include "net/base/cache_type.h"
21 #include "net/cert/cert_verifier.h" 22 #include "net/cert/cert_verifier.h"
22 #include "net/cert/ct_policy_enforcer.h" 23 #include "net/cert/ct_policy_enforcer.h"
23 #include "net/cert/multi_log_ct_verifier.h" 24 #include "net/cert/multi_log_ct_verifier.h"
24 #include "net/dns/host_resolver.h" 25 #include "net/dns/host_resolver.h"
25 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h" 26 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
26 #include "net/http/http_auth_handler_factory.h" 27 #include "net/http/http_auth_handler_factory.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool cookie_path_found = PathService::Get(base::DIR_APP_DATA, &cookie_path); 79 bool cookie_path_found = PathService::Get(base::DIR_APP_DATA, &cookie_path);
79 DCHECK(cookie_path_found); 80 DCHECK(cookie_path_found);
80 cookie_path = cookie_path.Append("WebShell").Append("Cookies"); 81 cookie_path = cookie_path.Append("WebShell").Append("Cookies");
81 scoped_refptr<net::CookieMonster::PersistentCookieStore> persistent_store = 82 scoped_refptr<net::CookieMonster::PersistentCookieStore> persistent_store =
82 new net::SQLitePersistentCookieStore( 83 new net::SQLitePersistentCookieStore(
83 cookie_path, network_task_runner_, 84 cookie_path, network_task_runner_,
84 web::WebThread::GetBlockingPool()->GetSequencedTaskRunner( 85 web::WebThread::GetBlockingPool()->GetSequencedTaskRunner(
85 web::WebThread::GetBlockingPool()->GetSequenceToken()), 86 web::WebThread::GetBlockingPool()->GetSequenceToken()),
86 true, nullptr); 87 true, nullptr);
87 std::unique_ptr<net::CookieStoreIOS> cookie_store( 88 std::unique_ptr<net::CookieStoreIOS> cookie_store(
88 new net::CookieStoreIOS(persistent_store.get())); 89 new net::CookieStoreIOSPersistent(persistent_store.get()));
89 storage_->set_cookie_store(std::move(cookie_store)); 90 storage_->set_cookie_store(std::move(cookie_store));
90 91
91 std::string user_agent = web::GetWebClient()->GetUserAgent(false); 92 std::string user_agent = web::GetWebClient()->GetUserAgent(false);
92 storage_->set_http_user_agent_settings( 93 storage_->set_http_user_agent_settings(
93 base::MakeUnique<net::StaticHttpUserAgentSettings>("en-us,en", 94 base::MakeUnique<net::StaticHttpUserAgentSettings>("en-us,en",
94 user_agent)); 95 user_agent));
95 storage_->set_proxy_service( 96 storage_->set_proxy_service(
96 net::ProxyService::CreateUsingSystemProxyResolver( 97 net::ProxyService::CreateUsingSystemProxyResolver(
97 std::move(proxy_config_service_), 0, 98 std::move(proxy_config_service_), 0,
98 url_request_context_->net_log())); 99 url_request_context_->net_log()));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 return url_request_context_.get(); 170 return url_request_context_.get();
170 } 171 }
171 172
172 scoped_refptr<base::SingleThreadTaskRunner> 173 scoped_refptr<base::SingleThreadTaskRunner>
173 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 174 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
174 return network_task_runner_; 175 return network_task_runner_;
175 } 176 }
176 177
177 } // namespace web 178 } // namespace web
OLDNEW
« ios/net/cookies/cookie_store_ios_persistent.h ('K') | « ios/net/cookies/cookie_store_ios_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698