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

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

Issue 1873683002: Convert //chrome/browser/sync_file_system from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 <string> 10 #include <string>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 17
18 namespace sync_file_system { 18 namespace sync_file_system {
19 19
20 class TaskLogger : public base::SupportsWeakPtr<TaskLogger> { 20 class TaskLogger : public base::SupportsWeakPtr<TaskLogger> {
21 public: 21 public:
22 struct TaskLog { 22 struct TaskLog {
23 int log_id; 23 int log_id;
(...skipping 17 matching lines...) Expand all
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(scoped_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 std::deque<TaskLog*> 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
« no previous file with comments | « chrome/browser/sync_file_system/sync_process_runner_unittest.cc ('k') | chrome/browser/sync_file_system/task_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698