OLD | NEW |
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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 380 } |
381 | 381 |
382 // setup cookie store | 382 // setup cookie store |
383 if (!cookie_store.get()) { | 383 if (!cookie_store.get()) { |
384 DCHECK(!lazy_params_->cookie_path.empty()); | 384 DCHECK(!lazy_params_->cookie_path.empty()); |
385 | 385 |
386 cookie_store = content::CreatePersistentCookieStore( | 386 cookie_store = content::CreatePersistentCookieStore( |
387 lazy_params_->cookie_path, | 387 lazy_params_->cookie_path, |
388 lazy_params_->restore_old_session_cookies, | 388 lazy_params_->restore_old_session_cookies, |
389 lazy_params_->special_storage_policy.get(), | 389 lazy_params_->special_storage_policy.get(), |
390 profile_params->cookie_monster_delegate.get()); | 390 profile_params->cookie_monster_delegate.get(), |
| 391 scoped_refptr<base::SequencedTaskRunner>()); |
391 cookie_store->GetCookieMonster()->SetPersistSessionCookies(true); | 392 cookie_store->GetCookieMonster()->SetPersistSessionCookies(true); |
392 } | 393 } |
393 | 394 |
394 main_context->set_cookie_store(cookie_store.get()); | 395 main_context->set_cookie_store(cookie_store.get()); |
395 | 396 |
396 // Setup server bound cert service. | 397 // Setup server bound cert service. |
397 if (!server_bound_cert_service) { | 398 if (!server_bound_cert_service) { |
398 DCHECK(!lazy_params_->server_bound_cert_path.empty()); | 399 DCHECK(!lazy_params_->server_bound_cert_path.empty()); |
399 | 400 |
400 scoped_refptr<SQLiteServerBoundCertStore> server_bound_cert_db = | 401 scoped_refptr<SQLiteServerBoundCertStore> server_bound_cert_db = |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 extensions_context->set_net_log(io_thread->net_log()); | 476 extensions_context->set_net_log(io_thread->net_log()); |
476 | 477 |
477 extensions_context->set_throttler_manager( | 478 extensions_context->set_throttler_manager( |
478 io_thread_globals->throttler_manager.get()); | 479 io_thread_globals->throttler_manager.get()); |
479 | 480 |
480 net::CookieStore* extensions_cookie_store = | 481 net::CookieStore* extensions_cookie_store = |
481 content::CreatePersistentCookieStore( | 482 content::CreatePersistentCookieStore( |
482 lazy_params_->extensions_cookie_path, | 483 lazy_params_->extensions_cookie_path, |
483 lazy_params_->restore_old_session_cookies, | 484 lazy_params_->restore_old_session_cookies, |
484 NULL, | 485 NULL, |
485 NULL); | 486 NULL, |
| 487 scoped_refptr<base::SequencedTaskRunner>()); |
486 // Enable cookies for devtools and extension URLs. | 488 // Enable cookies for devtools and extension URLs. |
487 const char* schemes[] = {chrome::kChromeDevToolsScheme, | 489 const char* schemes[] = {chrome::kChromeDevToolsScheme, |
488 extensions::kExtensionScheme}; | 490 extensions::kExtensionScheme}; |
489 extensions_cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 2); | 491 extensions_cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 2); |
490 extensions_context->set_cookie_store(extensions_cookie_store); | 492 extensions_context->set_cookie_store(extensions_cookie_store); |
491 | 493 |
492 scoped_ptr<net::URLRequestJobFactoryImpl> extensions_job_factory( | 494 scoped_ptr<net::URLRequestJobFactoryImpl> extensions_job_factory( |
493 new net::URLRequestJobFactoryImpl()); | 495 new net::URLRequestJobFactoryImpl()); |
494 // TODO(shalev): The extensions_job_factory has a NULL NetworkDelegate. | 496 // TODO(shalev): The extensions_job_factory has a NULL NetworkDelegate. |
495 // Without a network_delegate, this protocol handler will never | 497 // Without a network_delegate, this protocol handler will never |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 if (!cookie_store.get()) { | 563 if (!cookie_store.get()) { |
562 DCHECK(!cookie_path.empty()); | 564 DCHECK(!cookie_path.empty()); |
563 | 565 |
564 // TODO(creis): We should have a cookie delegate for notifying the cookie | 566 // TODO(creis): We should have a cookie delegate for notifying the cookie |
565 // extensions API, but we need to update it to understand isolated apps | 567 // extensions API, but we need to update it to understand isolated apps |
566 // first. | 568 // first. |
567 cookie_store = content::CreatePersistentCookieStore( | 569 cookie_store = content::CreatePersistentCookieStore( |
568 cookie_path, | 570 cookie_path, |
569 false, | 571 false, |
570 NULL, | 572 NULL, |
571 NULL); | 573 NULL, |
| 574 scoped_refptr<base::SequencedTaskRunner>()); |
572 } | 575 } |
573 | 576 |
574 // Transfer ownership of the cookies and cache to AppRequestContext. | 577 // Transfer ownership of the cookies and cache to AppRequestContext. |
575 context->SetCookieStore(cookie_store.get()); | 578 context->SetCookieStore(cookie_store.get()); |
576 context->SetHttpTransactionFactory( | 579 context->SetHttpTransactionFactory( |
577 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); | 580 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
578 | 581 |
579 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 582 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
580 new net::URLRequestJobFactoryImpl()); | 583 new net::URLRequestJobFactoryImpl()); |
581 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 584 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 const base::Closure& completion) { | 695 const base::Closure& completion) { |
693 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 696 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
694 DCHECK(initialized()); | 697 DCHECK(initialized()); |
695 | 698 |
696 DCHECK(transport_security_state()); | 699 DCHECK(transport_security_state()); |
697 // Completes synchronously. | 700 // Completes synchronously. |
698 transport_security_state()->DeleteAllDynamicDataSince(time); | 701 transport_security_state()->DeleteAllDynamicDataSince(time); |
699 DCHECK(http_server_properties_manager_); | 702 DCHECK(http_server_properties_manager_); |
700 http_server_properties_manager_->Clear(completion); | 703 http_server_properties_manager_->Clear(completion); |
701 } | 704 } |
OLD | NEW |