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_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_EVENT_S
TORE_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_EVENT_S
TORE_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_EVENT_S
TORE_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_EVENT_S
TORE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <deque> | 10 #include <deque> |
9 #include <string> | 11 #include <string> |
10 | 12 |
11 #include "base/basictypes.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
13 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
14 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_storage_delegate.h" | 16 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_storage_delegate.h" |
15 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 17 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
16 | 18 |
17 namespace base { | 19 namespace base { |
18 class DictionaryValue; | 20 class DictionaryValue; |
19 class TimeDelta; | 21 class TimeDelta; |
20 class Value; | 22 class Value; |
21 } | 23 } |
(...skipping 30 matching lines...) Expand all Loading... |
52 // Override of DataReductionProxyEventStorageDelegate. | 54 // Override of DataReductionProxyEventStorageDelegate. |
53 // Put |entry| on a deque of events to store and set | 55 // Put |entry| on a deque of events to store and set |
54 // |secure_proxy_check_state_| | 56 // |secure_proxy_check_state_| |
55 void AddEventAndSecureProxyCheckState(scoped_ptr<base::Value> entry, | 57 void AddEventAndSecureProxyCheckState(scoped_ptr<base::Value> entry, |
56 SecureProxyCheckState state) override; | 58 SecureProxyCheckState state) override; |
57 | 59 |
58 // Override of DataReductionProxyEventStorageDelegate. | 60 // Override of DataReductionProxyEventStorageDelegate. |
59 // Put |entry| on a deque of events to store and set |last_bypass_event_| and | 61 // Put |entry| on a deque of events to store and set |last_bypass_event_| and |
60 // |expiration_ticks_| | 62 // |expiration_ticks_| |
61 void AddAndSetLastBypassEvent(scoped_ptr<base::Value> entry, | 63 void AddAndSetLastBypassEvent(scoped_ptr<base::Value> entry, |
62 int64 expiration_ticks) override; | 64 int64_t expiration_ticks) override; |
63 | 65 |
64 // Returns the list of proxy servers for HTTP origins. | 66 // Returns the list of proxy servers for HTTP origins. |
65 std::string GetHttpProxyList() const; | 67 std::string GetHttpProxyList() const; |
66 | 68 |
67 // Returns the list of proxy servers for HTTPS origins. | 69 // Returns the list of proxy servers for HTTPS origins. |
68 std::string GetHttpsProxyList() const; | 70 std::string GetHttpsProxyList() const; |
69 | 71 |
70 // Returns a sanitized version of the last seen bypass event. | 72 // Returns a sanitized version of the last seen bypass event. |
71 std::string SanitizedLastBypassEvent() const; | 73 std::string SanitizedLastBypassEvent() const; |
72 | 74 |
73 private: | 75 private: |
74 friend class DataReductionProxyEventStoreTest; | 76 friend class DataReductionProxyEventStoreTest; |
75 | 77 |
76 // A deque of data reduction proxy related events. It is used as a circular | 78 // A deque of data reduction proxy related events. It is used as a circular |
77 // buffer to prevent unbounded memory utilization. | 79 // buffer to prevent unbounded memory utilization. |
78 std::deque<base::Value*> stored_events_; | 80 std::deque<base::Value*> stored_events_; |
79 // Whether the data reduction proxy is enabled or not. | 81 // Whether the data reduction proxy is enabled or not. |
80 bool enabled_; | 82 bool enabled_; |
81 // The current data reduction proxy configuration. | 83 // The current data reduction proxy configuration. |
82 scoped_ptr<base::Value> current_configuration_; | 84 scoped_ptr<base::Value> current_configuration_; |
83 // The state based on the last secure proxy check. | 85 // The state based on the last secure proxy check. |
84 SecureProxyCheckState secure_proxy_check_state_; | 86 SecureProxyCheckState secure_proxy_check_state_; |
85 // The last seen data reduction proxy bypass event. | 87 // The last seen data reduction proxy bypass event. |
86 scoped_ptr<base::Value> last_bypass_event_; | 88 scoped_ptr<base::Value> last_bypass_event_; |
87 // The expiration time of the |last_bypass_event_|. | 89 // The expiration time of the |last_bypass_event_|. |
88 int64 expiration_ticks_; | 90 int64_t expiration_ticks_; |
89 | 91 |
90 // Enforce usage on the UI thread. | 92 // Enforce usage on the UI thread. |
91 base::ThreadChecker thread_checker_; | 93 base::ThreadChecker thread_checker_; |
92 | 94 |
93 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyEventStore); | 95 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyEventStore); |
94 }; | 96 }; |
95 | 97 |
96 } // namespace data_reduction_proxy | 98 } // namespace data_reduction_proxy |
97 | 99 |
98 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_EVEN
T_STORE_H_ | 100 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_EVEN
T_STORE_H_ |
OLD | NEW |