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

Unified Diff: components/cronet/ios/cronet_environment.mm

Issue 2513023002: [Cronet] Add CookieStoreIOS. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « components/cronet/ios/cronet_environment.cc ('k') | components/cronet/ios/test/cronet_http_test.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/cronet_environment.mm
diff --git a/components/cronet/ios/cronet_environment.cc b/components/cronet/ios/cronet_environment.mm
similarity index 97%
rename from components/cronet/ios/cronet_environment.cc
rename to components/cronet/ios/cronet_environment.mm
index f136118a789f40eb110fc0e6b52d33c3a05b8c79..101e1f4db64ca8b5a470571b7999ed2d96389537 100644
--- a/components/cronet/ios/cronet_environment.cc
+++ b/components/cronet/ios/cronet_environment.mm
@@ -27,6 +27,7 @@
#include "components/cronet/ios/version.h"
#include "components/prefs/json_pref_store.h"
#include "components/prefs/pref_filter.h"
+#include "ios/net/cookies/cookie_store_ios.h"
#include "ios/web/public/user_agent.h"
#include "net/base/net_errors.h"
#include "net/base/network_change_notifier.h"
@@ -36,6 +37,7 @@
#include "net/cert/ct_policy_enforcer.h"
#include "net/cert/ct_verifier.h"
#include "net/cert/multi_log_ct_verifier.h"
+#include "net/cookies/cookie_store.h"
#include "net/dns/host_resolver.h"
#include "net/dns/mapped_host_resolver.h"
#include "net/http/http_auth_handler_factory.h"
@@ -263,7 +265,7 @@ void CronetEnvironment::Start() {
}
CronetEnvironment::~CronetEnvironment() {
-// net::HTTPProtocolHandlerDelegate::SetInstance(nullptr);
+ // net::HTTPProtocolHandlerDelegate::SetInstance(nullptr);
kapishnikov 2016/11/18 20:58:03 Why do we need it here?
mef 2016/11/18 22:29:36 git cl format is different for .mm and .cc.
}
void CronetEnvironment::InitializeOnNetworkThread() {
@@ -343,8 +345,8 @@ void CronetEnvironment::InitializeOnNetworkThread() {
params.enable_quic = quic_enabled();
for (const auto& quic_hint : quic_hints_) {
- net::AlternativeService alternative_service(net::AlternateProtocol::QUIC,
- "", quic_hint.port());
+ net::AlternativeService alternative_service(net::kProtoQUIC, "",
kapishnikov 2016/11/18 20:58:03 Why are we changing net::AlternateProtocol::QUIC t
mef 2016/11/18 22:29:36 Synced to head.
+ quic_hint.port());
url::SchemeHostPort quic_hint_server("https", quic_hint.host(),
quic_hint.port());
main_context_->http_server_properties()->SetAlternativeService(
@@ -370,6 +372,10 @@ void CronetEnvironment::InitializeOnNetworkThread() {
new net::HttpCache(http_network_session, std::move(main_backend),
true /* set_up_quic_server_info */);
main_context_->set_http_transaction_factory(main_cache);
+ // Cookies
+ cookie_store_ = net::CookieStoreIOS::CreateCookieStore(
+ [NSHTTPCookieStorage sharedHTTPCookieStorage]);
+ main_context_->set_cookie_store(cookie_store_.get());
net::URLRequestJobFactoryImpl* job_factory =
new net::URLRequestJobFactoryImpl;
« no previous file with comments | « components/cronet/ios/cronet_environment.cc ('k') | components/cronet/ios/test/cronet_http_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698