Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: chrome/browser/sync_file_system/task_logger.h

Issue 2314833002: Remove some uses of stl_util's STLDeleteContainerPointers. (Closed)
Patch Set: remove more Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_SYNC_FILE_SYSTEM_TASK_LOGGER_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_TASK_LOGGER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_TASK_LOGGER_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_TASK_LOGGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 base::TimeTicks start_time; 24 base::TimeTicks start_time;
25 base::TimeTicks end_time; 25 base::TimeTicks end_time;
26 std::string task_description; 26 std::string task_description;
27 std::string result_description; 27 std::string result_description;
28 std::vector<std::string> details; 28 std::vector<std::string> details;
29 29
30 TaskLog(); 30 TaskLog();
31 ~TaskLog(); 31 ~TaskLog();
32 }; 32 };
33 33
34 typedef std::deque<TaskLog*> LogList; 34 using LogList = std::deque<std::unique_ptr<TaskLog>>;
35 35
36 class Observer { 36 class Observer {
37 public: 37 public:
38 virtual void OnLogRecorded(const TaskLog& task_log) = 0; 38 virtual void OnLogRecorded(const TaskLog& task_log) = 0;
39 39
40 protected: 40 protected:
41 Observer() {} 41 Observer() {}
42 virtual ~Observer() {} 42 virtual ~Observer() {}
43 43
44 private: 44 private:
45 DISALLOW_COPY_AND_ASSIGN(Observer); 45 DISALLOW_COPY_AND_ASSIGN(Observer);
46 }; 46 };
47 47
48 TaskLogger(); 48 TaskLogger();
49 ~TaskLogger(); 49 ~TaskLogger();
50 50
51 void RecordLog(std::unique_ptr<TaskLog> log); 51 void RecordLog(std::unique_ptr<TaskLog> log);
52 void ClearLog(); 52 void ClearLog();
53 53
54 void AddObserver(Observer* observer); 54 void AddObserver(Observer* observer);
55 void RemoveObserver(Observer* observer); 55 void RemoveObserver(Observer* observer);
56 56
57 const LogList& GetLog() const; 57 const LogList& GetLog() const;
58 58
59 private: 59 private:
60 std::deque<TaskLog*> log_history_; 60 LogList log_history_;
61 61
62 base::ObserverList<Observer> observers_; 62 base::ObserverList<Observer> observers_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(TaskLogger); 64 DISALLOW_COPY_AND_ASSIGN(TaskLogger);
65 }; 65 };
66 66
67 } // namespace sync_file_system 67 } // namespace sync_file_system
68 68
69 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_TASK_LOGGER_H_ 69 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_TASK_LOGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698