OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/files/important_file_writer.h" | 5 #include "base/files/important_file_writer.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
7 #include <stdio.h> | 9 #include <stdio.h> |
8 #include <string> | 10 #include <string> |
9 #include <utility> | 11 #include <utility> |
10 | 12 |
11 #include "base/bind.h" | 13 #include "base/bind.h" |
12 #include "base/critical_closure.h" | 14 #include "base/critical_closure.h" |
13 #include "base/debug/alias.h" | 15 #include "base/debug/alias.h" |
14 #include "base/files/file.h" | 16 #include "base/files/file.h" |
15 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
16 #include "base/files/file_util.h" | 18 #include "base/files/file_util.h" |
17 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/macros.h" |
18 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
19 #include "base/numerics/safe_conversions.h" | 22 #include "base/numerics/safe_conversions.h" |
20 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
22 #include "base/task_runner.h" | 25 #include "base/task_runner.h" |
23 #include "base/task_runner_util.h" | 26 #include "base/task_runner_util.h" |
24 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
25 #include "base/time/time.h" | 28 #include "base/time/time.h" |
| 29 #include "build/build_config.h" |
26 | 30 |
27 namespace base { | 31 namespace base { |
28 | 32 |
29 namespace { | 33 namespace { |
30 | 34 |
31 const int kDefaultCommitIntervalMs = 10000; | 35 const int kDefaultCommitIntervalMs = 10000; |
32 | 36 |
33 // This enum is used to define the buckets for an enumerated UMA histogram. | 37 // This enum is used to define the buckets for an enumerated UMA histogram. |
34 // Hence, | 38 // Hence, |
35 // (a) existing enumerated constants should never be deleted or reordered, and | 39 // (a) existing enumerated constants should never be deleted or reordered, and |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 230 |
227 void ImportantFileWriter::ForwardSuccessfulWrite(bool result) { | 231 void ImportantFileWriter::ForwardSuccessfulWrite(bool result) { |
228 DCHECK(CalledOnValidThread()); | 232 DCHECK(CalledOnValidThread()); |
229 if (result && !on_next_successful_write_.is_null()) { | 233 if (result && !on_next_successful_write_.is_null()) { |
230 on_next_successful_write_.Run(); | 234 on_next_successful_write_.Run(); |
231 on_next_successful_write_.Reset(); | 235 on_next_successful_write_.Reset(); |
232 } | 236 } |
233 } | 237 } |
234 | 238 |
235 } // namespace base | 239 } // namespace base |
OLD | NEW |