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

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

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
« no previous file with comments | « chrome/browser/sync_file_system/task_logger.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/sync_file_system/task_logger.h" 5 #include "chrome/browser/sync_file_system/task_logger.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 19 matching lines...) Expand all
30 30
31 TaskLogger::TaskLog::TaskLog() : log_id(GenerateLogID()) {} 31 TaskLogger::TaskLog::TaskLog() : log_id(GenerateLogID()) {}
32 TaskLogger::TaskLog::~TaskLog() {} 32 TaskLogger::TaskLog::~TaskLog() {}
33 33
34 TaskLogger::TaskLogger() {} 34 TaskLogger::TaskLogger() {}
35 35
36 TaskLogger::~TaskLogger() { 36 TaskLogger::~TaskLogger() {
37 ClearLog(); 37 ClearLog();
38 } 38 }
39 39
40 void TaskLogger::RecordLog(scoped_ptr<TaskLog> log) { 40 void TaskLogger::RecordLog(std::unique_ptr<TaskLog> log) {
41 if (!log) 41 if (!log)
42 return; 42 return;
43 43
44 if (log_history_.size() >= kMaxLogSize) { 44 if (log_history_.size() >= kMaxLogSize) {
45 delete log_history_.front(); 45 delete log_history_.front();
46 log_history_.pop_front(); 46 log_history_.pop_front();
47 } 47 }
48 48
49 log_history_.push_back(log.release()); 49 log_history_.push_back(log.release());
50 50
(...skipping 12 matching lines...) Expand all
63 63
64 void TaskLogger::RemoveObserver(Observer* observer) { 64 void TaskLogger::RemoveObserver(Observer* observer) {
65 observers_.RemoveObserver(observer); 65 observers_.RemoveObserver(observer);
66 } 66 }
67 67
68 const TaskLogger::LogList& TaskLogger::GetLog() const { 68 const TaskLogger::LogList& TaskLogger::GetLog() const {
69 return log_history_; 69 return log_history_;
70 } 70 }
71 71
72 } // namespace sync_file_system 72 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/task_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698