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 "chrome/common/important_file_writer.h" | 5 #include "chrome/common/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/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop_proxy.h" | 15 #include "base/message_loop_proxy.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
18 #include "base/task.h" | |
19 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
20 #include "base/time.h" | 19 #include "base/time.h" |
21 | 20 |
22 using base::TimeDelta; | 21 using base::TimeDelta; |
23 | 22 |
24 namespace { | 23 namespace { |
25 | 24 |
26 const int kDefaultCommitIntervalMs = 10000; | 25 const int kDefaultCommitIntervalMs = 10000; |
27 | 26 |
28 enum TempFileFailure { | 27 enum TempFileFailure { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 DCHECK(serializer_); | 148 DCHECK(serializer_); |
150 std::string data; | 149 std::string data; |
151 if (serializer_->SerializeData(&data)) { | 150 if (serializer_->SerializeData(&data)) { |
152 WriteNow(data); | 151 WriteNow(data); |
153 } else { | 152 } else { |
154 DLOG(WARNING) << "failed to serialize data to be saved in " | 153 DLOG(WARNING) << "failed to serialize data to be saved in " |
155 << path_.value(); | 154 << path_.value(); |
156 } | 155 } |
157 serializer_ = NULL; | 156 serializer_ = NULL; |
158 } | 157 } |
OLD | NEW |