OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/browser/signin_manager_cookie_helper.h" | 5 #include "components/signin/core/browser/signin_manager_cookie_helper.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" |
10 #include "google_apis/gaia/gaia_urls.h" | 11 #include "google_apis/gaia/gaia_urls.h" |
11 #include "net/cookies/cookie_monster.h" | 12 #include "net/cookies/cookie_monster.h" |
12 #include "net/url_request/url_request_context.h" | 13 #include "net/url_request/url_request_context.h" |
13 | 14 |
14 SigninManagerCookieHelper::SigninManagerCookieHelper( | 15 SigninManagerCookieHelper::SigninManagerCookieHelper( |
15 net::URLRequestContextGetter* request_context_getter, | 16 net::URLRequestContextGetter* request_context_getter, |
16 scoped_refptr<base::MessageLoopProxy> ui_thread, | 17 scoped_refptr<base::SingleThreadTaskRunner> ui_thread, |
17 scoped_refptr<base::MessageLoopProxy> io_thread) | 18 scoped_refptr<base::SingleThreadTaskRunner> io_thread) |
18 : request_context_getter_(request_context_getter), | 19 : request_context_getter_(request_context_getter), |
19 ui_thread_(ui_thread), | 20 ui_thread_(ui_thread), |
20 io_thread_(io_thread) { | 21 io_thread_(io_thread) { |
21 DCHECK(ui_thread_->BelongsToCurrentThread()); | 22 DCHECK(ui_thread_->BelongsToCurrentThread()); |
22 } | 23 } |
23 | 24 |
24 SigninManagerCookieHelper::~SigninManagerCookieHelper() { | 25 SigninManagerCookieHelper::~SigninManagerCookieHelper() { |
25 } | 26 } |
26 | 27 |
27 void SigninManagerCookieHelper::StartFetchingGaiaCookiesOnUIThread( | 28 void SigninManagerCookieHelper::StartFetchingGaiaCookiesOnUIThread( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DCHECK(io_thread_->BelongsToCurrentThread()); | 64 DCHECK(io_thread_->BelongsToCurrentThread()); |
64 ui_thread_->PostTask(FROM_HERE, | 65 ui_thread_->PostTask(FROM_HERE, |
65 base::Bind(&SigninManagerCookieHelper::NotifyOnUIThread, this, cookies)); | 66 base::Bind(&SigninManagerCookieHelper::NotifyOnUIThread, this, cookies)); |
66 } | 67 } |
67 | 68 |
68 void SigninManagerCookieHelper::NotifyOnUIThread( | 69 void SigninManagerCookieHelper::NotifyOnUIThread( |
69 const net::CookieList& cookies) { | 70 const net::CookieList& cookies) { |
70 DCHECK(ui_thread_->BelongsToCurrentThread()); | 71 DCHECK(ui_thread_->BelongsToCurrentThread()); |
71 base::ResetAndReturn(&completion_callback_).Run(cookies); | 72 base::ResetAndReturn(&completion_callback_).Run(cookies); |
72 } | 73 } |
OLD | NEW |