| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_FILES_IMPORTANT_FILE_WRITER_H_ | 5 #ifndef BASE_FILES_IMPORTANT_FILE_WRITER_H_ |
| 6 #define BASE_FILES_IMPORTANT_FILE_WRITER_H_ | 6 #define BASE_FILES_IMPORTANT_FILE_WRITER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Invoked once and then reset on the next successful write event. | 115 // Invoked once and then reset on the next successful write event. |
| 116 Closure on_next_successful_write_; | 116 Closure on_next_successful_write_; |
| 117 | 117 |
| 118 // Path being written to. | 118 // Path being written to. |
| 119 const FilePath path_; | 119 const FilePath path_; |
| 120 | 120 |
| 121 // TaskRunner for the thread on which file I/O can be done. | 121 // TaskRunner for the thread on which file I/O can be done. |
| 122 const scoped_refptr<SequencedTaskRunner> task_runner_; | 122 const scoped_refptr<SequencedTaskRunner> task_runner_; |
| 123 | 123 |
| 124 // Timer used to schedule commit after ScheduleWrite. | 124 // Timer used to schedule commit after ScheduleWrite. |
| 125 OneShotTimer<ImportantFileWriter> timer_; | 125 OneShotTimer timer_; |
| 126 | 126 |
| 127 // Serializer which will provide the data to be saved. | 127 // Serializer which will provide the data to be saved. |
| 128 DataSerializer* serializer_; | 128 DataSerializer* serializer_; |
| 129 | 129 |
| 130 // Time delta after which scheduled data will be written to disk. | 130 // Time delta after which scheduled data will be written to disk. |
| 131 const TimeDelta commit_interval_; | 131 const TimeDelta commit_interval_; |
| 132 | 132 |
| 133 WeakPtrFactory<ImportantFileWriter> weak_factory_; | 133 WeakPtrFactory<ImportantFileWriter> weak_factory_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(ImportantFileWriter); | 135 DISALLOW_COPY_AND_ASSIGN(ImportantFileWriter); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace base | 138 } // namespace base |
| 139 | 139 |
| 140 #endif // BASE_FILES_IMPORTANT_FILE_WRITER_H_ | 140 #endif // BASE_FILES_IMPORTANT_FILE_WRITER_H_ |
| OLD | NEW |