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 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | |
392 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | |
393 BrowserThread::GetBlockingPool()->GetSequenceToken())); | |
joth
2013/09/14 19:40:24
could pass NULL for the second param and document
sgurun-gerrit only
2013/09/14 20:45:01
Done.
| |
391 cookie_store->GetCookieMonster()->SetPersistSessionCookies(true); | 394 cookie_store->GetCookieMonster()->SetPersistSessionCookies(true); |
392 } | 395 } |
393 | 396 |
394 main_context->set_cookie_store(cookie_store.get()); | 397 main_context->set_cookie_store(cookie_store.get()); |
395 | 398 |
396 // Setup server bound cert service. | 399 // Setup server bound cert service. |
397 if (!server_bound_cert_service) { | 400 if (!server_bound_cert_service) { |
398 DCHECK(!lazy_params_->server_bound_cert_path.empty()); | 401 DCHECK(!lazy_params_->server_bound_cert_path.empty()); |
399 | 402 |
400 scoped_refptr<SQLiteServerBoundCertStore> server_bound_cert_db = | 403 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()); | 478 extensions_context->set_net_log(io_thread->net_log()); |
476 | 479 |
477 extensions_context->set_throttler_manager( | 480 extensions_context->set_throttler_manager( |
478 io_thread_globals->throttler_manager.get()); | 481 io_thread_globals->throttler_manager.get()); |
479 | 482 |
480 net::CookieStore* extensions_cookie_store = | 483 net::CookieStore* extensions_cookie_store = |
481 content::CreatePersistentCookieStore( | 484 content::CreatePersistentCookieStore( |
482 lazy_params_->extensions_cookie_path, | 485 lazy_params_->extensions_cookie_path, |
483 lazy_params_->restore_old_session_cookies, | 486 lazy_params_->restore_old_session_cookies, |
484 NULL, | 487 NULL, |
485 NULL); | 488 NULL, |
489 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | |
490 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | |
491 BrowserThread::GetBlockingPool()->GetSequenceToken())); | |
joth
2013/09/14 19:40:24
yeah... seems nicer as this is duplicated several
sgurun-gerrit only
2013/09/14 20:45:01
Done.
| |
486 // Enable cookies for devtools and extension URLs. | 492 // Enable cookies for devtools and extension URLs. |
487 const char* schemes[] = {chrome::kChromeDevToolsScheme, | 493 const char* schemes[] = {chrome::kChromeDevToolsScheme, |
488 extensions::kExtensionScheme}; | 494 extensions::kExtensionScheme}; |
489 extensions_cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 2); | 495 extensions_cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 2); |
490 extensions_context->set_cookie_store(extensions_cookie_store); | 496 extensions_context->set_cookie_store(extensions_cookie_store); |
491 | 497 |
492 scoped_ptr<net::URLRequestJobFactoryImpl> extensions_job_factory( | 498 scoped_ptr<net::URLRequestJobFactoryImpl> extensions_job_factory( |
493 new net::URLRequestJobFactoryImpl()); | 499 new net::URLRequestJobFactoryImpl()); |
494 // TODO(shalev): The extensions_job_factory has a NULL NetworkDelegate. | 500 // TODO(shalev): The extensions_job_factory has a NULL NetworkDelegate. |
495 // Without a network_delegate, this protocol handler will never | 501 // 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()) { | 567 if (!cookie_store.get()) { |
562 DCHECK(!cookie_path.empty()); | 568 DCHECK(!cookie_path.empty()); |
563 | 569 |
564 // TODO(creis): We should have a cookie delegate for notifying the cookie | 570 // 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 | 571 // extensions API, but we need to update it to understand isolated apps |
566 // first. | 572 // first. |
567 cookie_store = content::CreatePersistentCookieStore( | 573 cookie_store = content::CreatePersistentCookieStore( |
568 cookie_path, | 574 cookie_path, |
569 false, | 575 false, |
570 NULL, | 576 NULL, |
571 NULL); | 577 NULL, |
578 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | |
579 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | |
580 BrowserThread::GetBlockingPool()->GetSequenceToken())); | |
572 } | 581 } |
573 | 582 |
574 // Transfer ownership of the cookies and cache to AppRequestContext. | 583 // Transfer ownership of the cookies and cache to AppRequestContext. |
575 context->SetCookieStore(cookie_store.get()); | 584 context->SetCookieStore(cookie_store.get()); |
576 context->SetHttpTransactionFactory( | 585 context->SetHttpTransactionFactory( |
577 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); | 586 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
578 | 587 |
579 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 588 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
580 new net::URLRequestJobFactoryImpl()); | 589 new net::URLRequestJobFactoryImpl()); |
581 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 590 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
692 const base::Closure& completion) { | 701 const base::Closure& completion) { |
693 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 702 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
694 DCHECK(initialized()); | 703 DCHECK(initialized()); |
695 | 704 |
696 DCHECK(transport_security_state()); | 705 DCHECK(transport_security_state()); |
697 // Completes synchronously. | 706 // Completes synchronously. |
698 transport_security_state()->DeleteAllDynamicDataSince(time); | 707 transport_security_state()->DeleteAllDynamicDataSince(time); |
699 DCHECK(http_server_properties_manager_); | 708 DCHECK(http_server_properties_manager_); |
700 http_server_properties_manager_->Clear(completion); | 709 http_server_properties_manager_->Clear(completion); |
701 } | 710 } |
OLD | NEW |