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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 10704021: Switched from having one URLRequestJobFactory per profile to having one per context. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed header file Created 8 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 media_request_context_->set_http_transaction_factory(media_cache); 430 media_request_context_->set_http_transaction_factory(media_cache);
431 431
432 ftp_factory_.reset( 432 ftp_factory_.reset(
433 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); 433 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get()));
434 main_context->set_ftp_transaction_factory(ftp_factory_.get()); 434 main_context->set_ftp_transaction_factory(ftp_factory_.get());
435 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get()); 435 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get());
436 436
437 main_context->set_chrome_url_data_manager_backend( 437 main_context->set_chrome_url_data_manager_backend(
438 chrome_url_data_manager_backend()); 438 chrome_url_data_manager_backend());
439 439
440 main_context->set_job_factory(job_factory()); 440 main_job_factory_.reset(new net::URLRequestJobFactory);
441 media_request_context_->set_job_factory(job_factory()); 441 media_request_job_factory_.reset(new net::URLRequestJobFactory);
442 extensions_context->set_job_factory(job_factory()); 442 extensions_job_factory_.reset(new net::URLRequestJobFactory);
443 443
444 job_factory()->AddInterceptor( 444 net::URLRequestJobFactory* job_factories[3];
445 new chrome_browser_net::ConnectInterceptor(predictor_.get())); 445 job_factories[0] = main_job_factory_.get();
446 job_factories[1] = media_request_job_factory_.get();
447 job_factories[2] = extensions_job_factory_.get();
448
449 for (int i = 0; i < 3; i++) {
450 SetUpJobFactoryDefaults(job_factories[i]);
451 job_factories[i]->AddInterceptor(
452 new chrome_browser_net::ConnectInterceptor(predictor_.get()));
453 }
454
455 main_context->set_job_factory(main_job_factory_.get());
456 media_request_context_->set_job_factory(media_request_job_factory_.get());
457 extensions_context->set_job_factory(extensions_job_factory_.get());
446 458
447 lazy_params_.reset(); 459 lazy_params_.reset();
448 } 460 }
449 461
450 ChromeURLRequestContext* 462 ChromeURLRequestContext*
451 ProfileImplIOData::InitializeAppRequestContext( 463 ProfileImplIOData::InitializeAppRequestContext(
452 ChromeURLRequestContext* main_context, 464 ChromeURLRequestContext* main_context,
453 const std::string& app_id) const { 465 const std::string& app_id) const {
454 AppRequestContext* context = new AppRequestContext; 466 AppRequestContext* context = new AppRequestContext;
455 467
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( 543 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
532 base::Time time) { 544 base::Time time) {
533 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 545 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
534 LazyInitialize(); 546 LazyInitialize();
535 547
536 DCHECK(transport_security_state()); 548 DCHECK(transport_security_state());
537 transport_security_state()->DeleteSince(time); 549 transport_security_state()->DeleteSince(time);
538 DCHECK(http_server_properties_manager()); 550 DCHECK(http_server_properties_manager());
539 http_server_properties_manager()->Clear(); 551 http_server_properties_manager()->Clear();
540 } 552 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698