Chromium Code Reviews| Index: chrome/browser/chromeos/login/login_utils.cc |
| =================================================================== |
| --- chrome/browser/chromeos/login/login_utils.cc (revision 95988) |
| +++ chrome/browser/chromeos/login/login_utils.cc (working copy) |
| @@ -126,14 +126,22 @@ |
| virtual void Run() { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| net::CookieStore* default_store = |
| - auth_context_->GetURLRequestContext()->cookie_store(); |
| + auth_context_->GetURLRequestContext()->cookie_store(); |
| net::CookieMonster* default_monster = default_store->GetCookieMonster(); |
| default_monster->SetKeepExpiredCookies(); |
| - net::CookieStore* new_store = |
| - new_context_->GetURLRequestContext()->cookie_store(); |
| - net::CookieMonster* new_monster = new_store->GetCookieMonster(); |
| + default_monster->GetAllCookiesAsync( |
| + base::Bind( |
| + &TransferDefaultCookiesOnIOThreadTask::InitializeCookieMonster, |
| + base::Unretained(this))); |
|
ycxiao
2011/08/09 14:46:38
Added "TransferDefaultCookiesOnIOThreadTask::".
|
| + } |
| - if (!new_monster->InitializeFrom(default_monster)) { |
| + void InitializeCookieMonster(const net::CookieList& cookies) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| + net::CookieStore* new_store = |
| + new_context_->GetURLRequestContext()->cookie_store(); |
| + net::CookieMonster* new_monster = new_store->GetCookieMonster(); |
| + |
| + if (!new_monster->InitializeFrom(cookies)) { |
| LOG(WARNING) << "Failed initial cookie transfer."; |
| } |
| } |