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" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
15 #include "base/time.h" | 15 #include "base/time/time.h" |
16 #include "base/timer.h" | 16 #include "base/timer/timer.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 | 19 |
20 class SequencedTaskRunner; | 20 class SequencedTaskRunner; |
21 class Thread; | 21 class Thread; |
22 | 22 |
23 // Helper to ensure that a file won't be corrupted by the write (for example on | 23 // Helper to ensure that a file won't be corrupted by the write (for example on |
24 // application crash). Consider a naive way to save an important file F: | 24 // application crash). Consider a naive way to save an important file F: |
25 // | 25 // |
26 // 1. Open F for writing, truncating it. | 26 // 1. Open F for writing, truncating it. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // Time delta after which scheduled data will be written to disk. | 113 // Time delta after which scheduled data will be written to disk. |
114 TimeDelta commit_interval_; | 114 TimeDelta commit_interval_; |
115 | 115 |
116 DISALLOW_COPY_AND_ASSIGN(ImportantFileWriter); | 116 DISALLOW_COPY_AND_ASSIGN(ImportantFileWriter); |
117 }; | 117 }; |
118 | 118 |
119 } // namespace base | 119 } // namespace base |
120 | 120 |
121 #endif // BASE_FILES_IMPORTANT_FILE_WRITER_H_ | 121 #endif // BASE_FILES_IMPORTANT_FILE_WRITER_H_ |
OLD | NEW |