Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_EVENT_LOGGER_H_ | |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_EVENT_LOGGER_H_ | |
| 7 | |
| 8 #include <deque> | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 | |
| 14 namespace offline_pages { | |
| 15 | |
| 16 class OfflineEventLogger { | |
|
Pete Williamson
2016/06/24 00:38:32
A class header comment with usage notes would be n
chili
2016/06/24 02:45:51
Done.
| |
| 17 public: | |
| 18 OfflineEventLogger(); | |
| 19 | |
| 20 ~OfflineEventLogger(); | |
| 21 | |
| 22 // Clears the recorded activities. | |
| 23 void Clear(); | |
| 24 | |
| 25 // Turns logging on/off. | |
| 26 void SetIsLogging(bool is_logging); | |
| 27 | |
| 28 // Dumps the current activity list into |records|. | |
| 29 void GetLogs(std::vector<std::string>& records); | |
| 30 | |
| 31 protected: | |
| 32 // Write the activity into the cycling log if we are currently logging. | |
| 33 void RecordActivity(const std::string& activity); | |
| 34 | |
| 35 private: | |
| 36 // Recorded offline page activities. | |
| 37 std::deque<std::string> activities_; | |
|
Pete Williamson
2016/06/24 00:38:32
I like your choice of a deque here, it fits perfec
chili
2016/06/24 02:45:51
Acknowledged. ^_^
| |
| 38 | |
| 39 // Whether we are currently recording logs or not. | |
| 40 bool is_logging_; | |
| 41 }; | |
| 42 } // namespace offline_pages | |
| 43 | |
| 44 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_EVENT_LOGGER_H_ | |
| OLD | NEW |