| 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 <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/critical_closure.h" | 12 #include "base/critical_closure.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/task_runner.h" | 18 #include "base/task_runner.h" |
| 19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 20 #include "base/time.h" | 20 #include "base/time/time.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const int kDefaultCommitIntervalMs = 10000; | 26 const int kDefaultCommitIntervalMs = 10000; |
| 27 | 27 |
| 28 enum TempFileFailure { | 28 enum TempFileFailure { |
| 29 FAILED_CREATING, | 29 FAILED_CREATING, |
| 30 FAILED_OPENING, | 30 FAILED_OPENING, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (serializer_->SerializeData(&data)) { | 158 if (serializer_->SerializeData(&data)) { |
| 159 WriteNow(data); | 159 WriteNow(data); |
| 160 } else { | 160 } else { |
| 161 DLOG(WARNING) << "failed to serialize data to be saved in " | 161 DLOG(WARNING) << "failed to serialize data to be saved in " |
| 162 << path_.value().c_str(); | 162 << path_.value().c_str(); |
| 163 } | 163 } |
| 164 serializer_ = NULL; | 164 serializer_ = NULL; |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace base | 167 } // namespace base |
| OLD | NEW |