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

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

Issue 1342613002: Revert of Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « google_apis/gcm/tools/mcs_probe.cc ('k') | ios/web/shell/shell_url_request_context_getter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (!params.channel_id_service) { 439 if (!params.channel_id_service) {
440 // The main context may not have a ChannelIDService, since it is lazily 440 // The main context may not have a ChannelIDService, since it is lazily
441 // constructed. If not, build an ephemeral ChannelIDService with no backing 441 // constructed. If not, build an ephemeral ChannelIDService with no backing
442 // disk store. 442 // disk store.
443 // TODO(ellyjones): support persisting ChannelID. 443 // TODO(ellyjones): support persisting ChannelID.
444 params.channel_id_service = new net::ChannelIDService( 444 params.channel_id_service = new net::ChannelIDService(
445 new net::DefaultChannelIDStore(NULL), 445 new net::DefaultChannelIDStore(NULL),
446 base::WorkerPool::GetTaskRunner(true)); 446 base::WorkerPool::GetTaskRunner(true));
447 } 447 }
448 448
449 // TODO(mmenke): These really shouldn't be leaked. 449 net::HttpCache* main_cache = new net::HttpCache(params, main_backend);
450 // See https://crbug.com/523858.
451 net::HttpNetworkSession* http_network_session =
452 new net::HttpNetworkSession(params);
453 net::HttpCache* main_cache = new net::HttpCache(
454 http_network_session, main_backend, true /* set_up_quic_server_info */);
455 main_context_->set_http_transaction_factory(main_cache); 450 main_context_->set_http_transaction_factory(main_cache);
456 451
457 // Cookies 452 // Cookies
458 scoped_refptr<net::CookieStore> cookie_store = 453 scoped_refptr<net::CookieStore> cookie_store =
459 net::CookieStoreIOS::CreateCookieStoreFromNSHTTPCookieStorage(); 454 net::CookieStoreIOS::CreateCookieStoreFromNSHTTPCookieStorage();
460 main_context_->set_cookie_store(cookie_store.get()); 455 main_context_->set_cookie_store(cookie_store.get());
461 456
462 net::URLRequestJobFactoryImpl* job_factory = 457 net::URLRequestJobFactoryImpl* job_factory =
463 new net::URLRequestJobFactoryImpl; 458 new net::URLRequestJobFactoryImpl;
464 job_factory->SetProtocolHandler( 459 job_factory->SetProtocolHandler(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 if (backend) 496 if (backend)
502 backend->DoomAllEntries(client_callback); 497 backend->DoomAllEntries(client_callback);
503 }); 498 });
504 int rc = cache->GetBackend(&backend, doom_callback); 499 int rc = cache->GetBackend(&backend, doom_callback);
505 if (rc != net::ERR_IO_PENDING) { 500 if (rc != net::ERR_IO_PENDING) {
506 // GetBackend doesn't call the callback if it completes synchronously, so 501 // GetBackend doesn't call the callback if it completes synchronously, so
507 // call it directly here. 502 // call it directly here.
508 doom_callback.Run(rc); 503 doom_callback.Run(rc);
509 } 504 }
510 } 505 }
OLDNEW
« no previous file with comments | « google_apis/gcm/tools/mcs_probe.cc ('k') | ios/web/shell/shell_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698