| 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/chromeos/login/profile_auth_data.h" | 5 #include "chrome/browser/chromeos/login/profile_auth_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 17 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
| 18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 19 #include "net/cookies/canonical_cookie.h" | 20 #include "net/cookies/canonical_cookie.h" |
| 20 #include "net/cookies/cookie_store.h" | 21 #include "net/cookies/cookie_store.h" |
| 21 #include "net/http/http_auth_cache.h" | 22 #include "net/http/http_auth_cache.h" |
| 22 #include "net/http/http_network_session.h" | 23 #include "net/http/http_network_session.h" |
| 23 #include "net/http/http_transaction_factory.h" | 24 #include "net/http/http_transaction_factory.h" |
| 24 #include "net/ssl/channel_id_service.h" | 25 #include "net/ssl/channel_id_service.h" |
| 25 #include "net/ssl/channel_id_store.h" | 26 #include "net/ssl/channel_id_store.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 ImportCookies(non_gaia_cookies, to_store); | 317 ImportCookies(non_gaia_cookies, to_store); |
| 317 } | 318 } |
| 318 | 319 |
| 319 Finish(); | 320 Finish(); |
| 320 } | 321 } |
| 321 | 322 |
| 322 void ProfileAuthDataTransferer::Finish() { | 323 void ProfileAuthDataTransferer::Finish() { |
| 323 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 324 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 324 if (!completion_callback_.is_null()) | 325 if (!completion_callback_.is_null()) |
| 325 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion_callback_); | 326 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion_callback_); |
| 326 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 327 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 327 } | 328 } |
| 328 | 329 |
| 329 } // namespace | 330 } // namespace |
| 330 | 331 |
| 331 void ProfileAuthData::Transfer( | 332 void ProfileAuthData::Transfer( |
| 332 net::URLRequestContextGetter* from_context, | 333 net::URLRequestContextGetter* from_context, |
| 333 net::URLRequestContextGetter* to_context, | 334 net::URLRequestContextGetter* to_context, |
| 334 bool transfer_auth_cookies_and_channel_ids_on_first_login, | 335 bool transfer_auth_cookies_and_channel_ids_on_first_login, |
| 335 bool transfer_saml_auth_cookies_on_subsequent_login, | 336 bool transfer_saml_auth_cookies_on_subsequent_login, |
| 336 const base::Closure& completion_callback) { | 337 const base::Closure& completion_callback) { |
| 337 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 338 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 338 (new ProfileAuthDataTransferer( | 339 (new ProfileAuthDataTransferer( |
| 339 from_context, | 340 from_context, |
| 340 to_context, | 341 to_context, |
| 341 transfer_auth_cookies_and_channel_ids_on_first_login, | 342 transfer_auth_cookies_and_channel_ids_on_first_login, |
| 342 transfer_saml_auth_cookies_on_subsequent_login, | 343 transfer_saml_auth_cookies_on_subsequent_login, |
| 343 completion_callback))->BeginTransfer(); | 344 completion_callback))->BeginTransfer(); |
| 344 } | 345 } |
| 345 | 346 |
| 346 } // namespace chromeos | 347 } // namespace chromeos |
| OLD | NEW |