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

Side by Side Diff: ios/crnet/crnet_environment.mm

Issue 2649083002: Divide CookieStoreIOS into two different classes with different backends (Closed)
Patch Set: fix compilation Created 3 years, 10 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/crnet/crnet_environment.h" 5 #include "ios/crnet/crnet_environment.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 // TODO(mmenke): These really shouldn't be leaked. 470 // TODO(mmenke): These really shouldn't be leaked.
471 // See https://crbug.com/523858. 471 // See https://crbug.com/523858.
472 net::HttpNetworkSession* http_network_session = 472 net::HttpNetworkSession* http_network_session =
473 new net::HttpNetworkSession(params); 473 new net::HttpNetworkSession(params);
474 net::HttpCache* main_cache = 474 net::HttpCache* main_cache =
475 new net::HttpCache(http_network_session, std::move(main_backend), 475 new net::HttpCache(http_network_session, std::move(main_backend),
476 true /* set_up_quic_server_info */); 476 true /* set_up_quic_server_info */);
477 main_context_->set_http_transaction_factory(main_cache); 477 main_context_->set_http_transaction_factory(main_cache);
478 478
479 // Cookies 479 // Cookies
480 cookie_store_ = net::CookieStoreIOS::CreateCookieStore( 480 cookie_store_ = base::MakeUnique<CookieStoreIOS>(
481 [NSHTTPCookieStorage sharedHTTPCookieStorage]); 481 [NSHTTPCookieStorage sharedHTTPCookieStorage]);
482 main_context_->set_cookie_store(cookie_store_.get()); 482 main_context_->set_cookie_store(cookie_store_.get());
483 483
484 net::URLRequestJobFactoryImpl* job_factory = 484 net::URLRequestJobFactoryImpl* job_factory =
485 new net::URLRequestJobFactoryImpl; 485 new net::URLRequestJobFactoryImpl;
486 job_factory->SetProtocolHandler( 486 job_factory->SetProtocolHandler(
487 "data", base::WrapUnique(new net::DataProtocolHandler)); 487 "data", base::WrapUnique(new net::DataProtocolHandler));
488 #if !BUILDFLAG(DISABLE_FILE_SUPPORT) 488 #if !BUILDFLAG(DISABLE_FILE_SUPPORT)
489 job_factory->SetProtocolHandler( 489 job_factory->SetProtocolHandler(
490 "file", 490 "file",
(...skipping 13 matching lines...) Expand all
504 504
505 return user_agent_settings->GetUserAgent(); 505 return user_agent_settings->GetUserAgent();
506 } 506 }
507 507
508 void CrNetEnvironment::ClearCache(ClearCacheCallback callback) { 508 void CrNetEnvironment::ClearCache(ClearCacheCallback callback) {
509 PostToNetworkThread( 509 PostToNetworkThread(
510 FROM_HERE, base::Bind(&net::ClearHttpCache, main_context_getter_, 510 FROM_HERE, base::Bind(&net::ClearHttpCache, main_context_getter_,
511 network_io_thread_->task_runner(), base::Time(), 511 network_io_thread_->task_runner(), base::Time(),
512 base::Time::Max(), base::BindBlock(callback))); 512 base::Time::Max(), base::BindBlock(callback)));
513 } 513 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698