| OLD | NEW |
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 51 FOR_EACH_OBSERVER(Observer, observers_, | 51 FOR_EACH_OBSERVER(Observer, observers_, |
| 52 OnLogRecorded(*log_history_.back())); | 52 OnLogRecorded(*log_history_.back())); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void TaskLogger::ClearLog() { | 55 void TaskLogger::ClearLog() { |
| 56 STLDeleteContainerPointers(log_history_.begin(), log_history_.end()); | 56 base::STLDeleteContainerPointers(log_history_.begin(), log_history_.end()); |
| 57 log_history_.clear(); | 57 log_history_.clear(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void TaskLogger::AddObserver(Observer* observer) { | 60 void TaskLogger::AddObserver(Observer* observer) { |
| 61 observers_.AddObserver(observer); | 61 observers_.AddObserver(observer); |
| 62 } | 62 } |
| 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 |
| OLD | NEW |