| 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 #ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ | 5 #ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ |
| 6 #define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ | 6 #define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // |max_ongoing_log_store_size_|). | 165 // |max_ongoing_log_store_size_|). |
| 166 // NOTE: This clears the contents of |log| (to avoid an expensive copy), | 166 // NOTE: This clears the contents of |log| (to avoid an expensive copy), |
| 167 // so the log should be discarded after this call. | 167 // so the log should be discarded after this call. |
| 168 void StoreLog(SerializedLog* log, | 168 void StoreLog(SerializedLog* log, |
| 169 LogType log_type, | 169 LogType log_type, |
| 170 StoreType store_type); | 170 StoreType store_type); |
| 171 | 171 |
| 172 // Compresses |current_log_| into |compressed_log|. | 172 // Compresses |current_log_| into |compressed_log|. |
| 173 void CompressCurrentLog(SerializedLog* compressed_log); | 173 void CompressCurrentLog(SerializedLog* compressed_log); |
| 174 | 174 |
| 175 // Tracks whether unsent logs (if any) have been loaded from the serializer. |
| 176 bool unsent_logs_loaded_; |
| 177 |
| 175 // The log that we are still appending to. | 178 // The log that we are still appending to. |
| 176 scoped_ptr<MetricsLogBase> current_log_; | 179 scoped_ptr<MetricsLogBase> current_log_; |
| 177 LogType current_log_type_; | 180 LogType current_log_type_; |
| 178 | 181 |
| 179 // A paused, previously-current log. | 182 // A paused, previously-current log. |
| 180 scoped_ptr<MetricsLogBase> paused_log_; | 183 scoped_ptr<MetricsLogBase> paused_log_; |
| 181 LogType paused_log_type_; | 184 LogType paused_log_type_; |
| 182 | 185 |
| 183 // Helper class to handle serialization/deserialization of logs for persistent | 186 // Helper class to handle serialization/deserialization of logs for persistent |
| 184 // storage. May be NULL. | 187 // storage. May be NULL. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 202 // This is necessary because during an upload there are two logs (staged | 205 // This is necessary because during an upload there are two logs (staged |
| 203 // and current) and a client might store them in either order, so it's | 206 // and current) and a client might store them in either order, so it's |
| 204 // not necessarily the case that the provisional store is the last store. | 207 // not necessarily the case that the provisional store is the last store. |
| 205 int last_provisional_store_index_; | 208 int last_provisional_store_index_; |
| 206 LogType last_provisional_store_type_; | 209 LogType last_provisional_store_type_; |
| 207 | 210 |
| 208 DISALLOW_COPY_AND_ASSIGN(MetricsLogManager); | 211 DISALLOW_COPY_AND_ASSIGN(MetricsLogManager); |
| 209 }; | 212 }; |
| 210 | 213 |
| 211 #endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ | 214 #endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ |
| OLD | NEW |