| 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/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 base::WorkerPool::GetTaskRunner(true)); | 381 base::WorkerPool::GetTaskRunner(true)); |
| 382 } | 382 } |
| 383 | 383 |
| 384 // setup cookie store | 384 // setup cookie store |
| 385 if (!cookie_store) { | 385 if (!cookie_store) { |
| 386 DCHECK(!lazy_params_->cookie_path.empty()); | 386 DCHECK(!lazy_params_->cookie_path.empty()); |
| 387 | 387 |
| 388 scoped_refptr<SQLitePersistentCookieStore> cookie_db = | 388 scoped_refptr<SQLitePersistentCookieStore> cookie_db = |
| 389 new SQLitePersistentCookieStore( | 389 new SQLitePersistentCookieStore( |
| 390 lazy_params_->cookie_path, | 390 lazy_params_->cookie_path, |
| 391 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 392 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
| 391 lazy_params_->restore_old_session_cookies, | 393 lazy_params_->restore_old_session_cookies, |
| 392 new ClearOnExitPolicy(lazy_params_->special_storage_policy)); | 394 new ClearOnExitPolicy(lazy_params_->special_storage_policy)); |
| 393 cookie_store = | 395 cookie_store = |
| 394 new net::CookieMonster(cookie_db.get(), | 396 new net::CookieMonster(cookie_db.get(), |
| 395 profile_params->cookie_monster_delegate); | 397 profile_params->cookie_monster_delegate); |
| 396 cookie_store->GetCookieMonster()->SetPersistSessionCookies(true); | 398 cookie_store->GetCookieMonster()->SetPersistSessionCookies(true); |
| 397 } | 399 } |
| 398 | 400 |
| 399 main_context->set_cookie_store(cookie_store); | 401 main_context->set_cookie_store(cookie_store); |
| 400 | 402 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 491 |
| 490 extensions_context->set_net_log(io_thread->net_log()); | 492 extensions_context->set_net_log(io_thread->net_log()); |
| 491 | 493 |
| 492 extensions_context->set_throttler_manager( | 494 extensions_context->set_throttler_manager( |
| 493 io_thread_globals->throttler_manager.get()); | 495 io_thread_globals->throttler_manager.get()); |
| 494 | 496 |
| 495 net::CookieMonster* extensions_cookie_store = | 497 net::CookieMonster* extensions_cookie_store = |
| 496 new net::CookieMonster( | 498 new net::CookieMonster( |
| 497 new SQLitePersistentCookieStore( | 499 new SQLitePersistentCookieStore( |
| 498 lazy_params_->extensions_cookie_path, | 500 lazy_params_->extensions_cookie_path, |
| 501 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 502 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
| 499 lazy_params_->restore_old_session_cookies, NULL), NULL); | 503 lazy_params_->restore_old_session_cookies, NULL), NULL); |
| 500 // Enable cookies for devtools and extension URLs. | 504 // Enable cookies for devtools and extension URLs. |
| 501 const char* schemes[] = {chrome::kChromeDevToolsScheme, | 505 const char* schemes[] = {chrome::kChromeDevToolsScheme, |
| 502 extensions::kExtensionScheme}; | 506 extensions::kExtensionScheme}; |
| 503 extensions_cookie_store->SetCookieableSchemes(schemes, 2); | 507 extensions_cookie_store->SetCookieableSchemes(schemes, 2); |
| 504 extensions_context->set_cookie_store(extensions_cookie_store); | 508 extensions_context->set_cookie_store(extensions_cookie_store); |
| 505 | 509 |
| 506 #if !defined(DISABLE_FTP_SUPPORT) | 510 #if !defined(DISABLE_FTP_SUPPORT) |
| 507 DCHECK(ftp_factory_.get()); | 511 DCHECK(ftp_factory_.get()); |
| 508 extensions_context->set_ftp_transaction_factory(ftp_factory_.get()); | 512 extensions_context->set_ftp_transaction_factory(ftp_factory_.get()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 cookie_store = new net::CookieMonster(NULL, NULL); | 589 cookie_store = new net::CookieMonster(NULL, NULL); |
| 586 app_http_cache->set_mode( | 590 app_http_cache->set_mode( |
| 587 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 591 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
| 588 } | 592 } |
| 589 | 593 |
| 590 // Use an app-specific cookie store. | 594 // Use an app-specific cookie store. |
| 591 if (!cookie_store) { | 595 if (!cookie_store) { |
| 592 DCHECK(!cookie_path.empty()); | 596 DCHECK(!cookie_path.empty()); |
| 593 | 597 |
| 594 scoped_refptr<SQLitePersistentCookieStore> cookie_db = | 598 scoped_refptr<SQLitePersistentCookieStore> cookie_db = |
| 595 new SQLitePersistentCookieStore(cookie_path, false, NULL); | 599 new SQLitePersistentCookieStore( |
| 600 cookie_path, |
| 601 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 602 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
| 603 false, |
| 604 NULL); |
| 596 // TODO(creis): We should have a cookie delegate for notifying the cookie | 605 // TODO(creis): We should have a cookie delegate for notifying the cookie |
| 597 // extensions API, but we need to update it to understand isolated apps | 606 // extensions API, but we need to update it to understand isolated apps |
| 598 // first. | 607 // first. |
| 599 cookie_store = new net::CookieMonster(cookie_db.get(), NULL); | 608 cookie_store = new net::CookieMonster(cookie_db.get(), NULL); |
| 600 } | 609 } |
| 601 | 610 |
| 602 // Transfer ownership of the cookies and cache to AppRequestContext. | 611 // Transfer ownership of the cookies and cache to AppRequestContext. |
| 603 context->SetCookieStore(cookie_store); | 612 context->SetCookieStore(cookie_store); |
| 604 context->SetHttpTransactionFactory( | 613 context->SetHttpTransactionFactory( |
| 605 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); | 614 scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 base::Time time, | 752 base::Time time, |
| 744 const base::Closure& completion) { | 753 const base::Closure& completion) { |
| 745 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 754 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 746 DCHECK(initialized()); | 755 DCHECK(initialized()); |
| 747 | 756 |
| 748 DCHECK(transport_security_state()); | 757 DCHECK(transport_security_state()); |
| 749 transport_security_state()->DeleteSince(time); // Completes synchronously. | 758 transport_security_state()->DeleteSince(time); // Completes synchronously. |
| 750 DCHECK(http_server_properties_manager_); | 759 DCHECK(http_server_properties_manager_); |
| 751 http_server_properties_manager_->Clear(completion); | 760 http_server_properties_manager_->Clear(completion); |
| 752 } | 761 } |
| OLD | NEW |