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 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_COOKIE_CHANGED_SUBSCRIPTION_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_COOKIE_CHANGED_SUBSCRIPTION_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_COOKIE_CHANGED_SUBSCRIPTION_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_COOKIE_CHANGED_SUBSCRIPTION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 const std::string& name); | 48 const std::string& name); |
49 | 49 |
50 // Posts a task on the |proxy| task runner that calls |OnCookieChanged| on | 50 // Posts a task on the |proxy| task runner that calls |OnCookieChanged| on |
51 // |subscription|. | 51 // |subscription|. |
52 // Note that this method is called on the network thread, so |subscription| | 52 // Note that this method is called on the network thread, so |subscription| |
53 // must not be used here, it is only passed around. | 53 // must not be used here, it is only passed around. |
54 static void RunAsyncOnCookieChanged( | 54 static void RunAsyncOnCookieChanged( |
55 scoped_refptr<base::TaskRunner> proxy, | 55 scoped_refptr<base::TaskRunner> proxy, |
56 base::WeakPtr<SigninCookieChangedSubscription> subscription, | 56 base::WeakPtr<SigninCookieChangedSubscription> subscription, |
57 const net::CanonicalCookie& cookie, | 57 const net::CanonicalCookie& cookie, |
58 bool removed); | 58 net::CookieStore::ChangeCause cause); |
59 | 59 |
60 // Handler for cookie changed events. | 60 // Handler for cookie changed events. |
61 void OnCookieChanged(const net::CanonicalCookie& cookie, bool removed); | 61 void OnCookieChanged(const net::CanonicalCookie& cookie, |
| 62 net::CookieStore::ChangeCause cause); |
62 | 63 |
63 // The context getter. | 64 // The context getter. |
64 scoped_refptr<net::URLRequestContextGetter> context_getter_; | 65 scoped_refptr<net::URLRequestContextGetter> context_getter_; |
65 | 66 |
66 // The holder of a cookie changed subscription. Must be destroyed on the | 67 // The holder of a cookie changed subscription. Must be destroyed on the |
67 // network thread. | 68 // network thread. |
68 std::unique_ptr<SubscriptionHolder> subscription_holder_io_; | 69 std::unique_ptr<SubscriptionHolder> subscription_holder_io_; |
69 | 70 |
70 // Callback to be run on cookie changed events. | 71 // Callback to be run on cookie changed events. |
71 net::CookieStore::CookieChangedCallback callback_; | 72 net::CookieStore::CookieChangedCallback callback_; |
72 | 73 |
73 base::ThreadChecker thread_checker_; | 74 base::ThreadChecker thread_checker_; |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(SigninCookieChangedSubscription); | 76 DISALLOW_COPY_AND_ASSIGN(SigninCookieChangedSubscription); |
76 }; | 77 }; |
77 | 78 |
78 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_COOKIE_CHANGED_SUBSCRIPTION_H_ | 79 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_COOKIE_CHANGED_SUBSCRIPTION_H_ |
OLD | NEW |