OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Defines the CookieAccountant class, which is responsible for observing | 5 // Defines the CookieAccountant class, which is responsible for observing |
6 // and recording all cookie-related information generated by a particular | 6 // and recording all cookie-related information generated by a particular |
7 // IE browser session. It records and fires cookie change events, it provides | 7 // IE browser session. It records and fires cookie change events, it provides |
8 // access to session and persistent cookies. | 8 // access to session and persistent cookies. |
9 | 9 |
10 #ifndef CEEE_IE_PLUGIN_BHO_COOKIE_ACCOUNTANT_H_ | 10 #ifndef CEEE_IE_PLUGIN_BHO_COOKIE_ACCOUNTANT_H_ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 static DWORD WINAPI InternetSetCookieExWPatch( | 45 static DWORD WINAPI InternetSetCookieExWPatch( |
46 LPCWSTR lpszURL, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, | 46 LPCWSTR lpszURL, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, |
47 DWORD dwFlags, DWORD_PTR dwReserved); | 47 DWORD dwFlags, DWORD_PTR dwReserved); |
48 | 48 |
49 protected: | 49 protected: |
50 // Exposed to subclasses mainly for unit testing purposes; production code | 50 // Exposed to subclasses mainly for unit testing purposes; production code |
51 // should use the ProductionCookieAccountant class instead. | 51 // should use the ProductionCookieAccountant class instead. |
52 // Since this class has one instance per window, not per tab, we cannot | 52 // Since this class has one instance per window, not per tab, we cannot |
53 // queue the events sent to the broker. They don't need to be sent to the BHO | 53 // queue the events sent to the broker. They don't need to be sent to the BHO |
54 // because they don't need tab_id anyway. | 54 // because they don't need tab_id anyway. |
55 CookieAccountant() : cookie_events_funnel_(new BrokerRpcClient) {} | 55 CookieAccountant() : cookie_events_funnel_(new BrokerRpcClient(true)) {} |
56 virtual ~CookieAccountant(); | 56 virtual ~CookieAccountant(); |
57 | 57 |
58 // Records the modification or creation of a cookie. Fires off a | 58 // Records the modification or creation of a cookie. Fires off a |
59 // cookies.onChanged event to Chrome Frame. | 59 // cookies.onChanged event to Chrome Frame. |
60 virtual void RecordCookie( | 60 virtual void RecordCookie( |
61 const std::string& url, const std::string& cookie_data, | 61 const std::string& url, const std::string& cookie_data, |
62 const base::Time& current_time); | 62 const base::Time& current_time); |
63 | 63 |
64 // Unit test seam. | 64 // Unit test seam. |
65 virtual CookieEventsFunnel& cookie_events_funnel() { | 65 virtual CookieEventsFunnel& cookie_events_funnel() { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // be accessed for unit testing. | 107 // be accessed for unit testing. |
108 class ProductionCookieAccountant : public CookieAccountant, | 108 class ProductionCookieAccountant : public CookieAccountant, |
109 public Singleton<ProductionCookieAccountant> { | 109 public Singleton<ProductionCookieAccountant> { |
110 private: | 110 private: |
111 // This ensures no construction is possible outside of the class itself. | 111 // This ensures no construction is possible outside of the class itself. |
112 friend struct DefaultSingletonTraits<ProductionCookieAccountant>; | 112 friend struct DefaultSingletonTraits<ProductionCookieAccountant>; |
113 DISALLOW_IMPLICIT_CONSTRUCTORS(ProductionCookieAccountant); | 113 DISALLOW_IMPLICIT_CONSTRUCTORS(ProductionCookieAccountant); |
114 }; | 114 }; |
115 | 115 |
116 #endif // CEEE_IE_PLUGIN_BHO_COOKIE_ACCOUNTANT_H_ | 116 #endif // CEEE_IE_PLUGIN_BHO_COOKIE_ACCOUNTANT_H_ |
OLD | NEW |