OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "base/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "base/time.h" | 18 #include "base/time.h" |
19 | 19 |
20 using base::TimeDelta; | 20 using base::TimeDelta; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 const int kDefaultCommitIntervalMs = 10000; | 24 const int kDefaultCommitIntervalMs = 10000; |
25 | 25 |
26 class WriteToDiskTask : public Task { | 26 class WriteToDiskTask : public Task { |
27 public: | 27 public: |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 DCHECK(serializer_); | 134 DCHECK(serializer_); |
135 std::string data; | 135 std::string data; |
136 if (serializer_->SerializeData(&data)) { | 136 if (serializer_->SerializeData(&data)) { |
137 WriteNow(data); | 137 WriteNow(data); |
138 } else { | 138 } else { |
139 LOG(WARNING) << "failed to serialize data to be saved in " | 139 LOG(WARNING) << "failed to serialize data to be saved in " |
140 << path_.value(); | 140 << path_.value(); |
141 } | 141 } |
142 serializer_ = NULL; | 142 serializer_ = NULL; |
143 } | 143 } |
OLD | NEW |