OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "net/disk_cache/simple/simple_util.h" | 5 #include "net/disk_cache/simple/simple_util.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/sha1.h" | 12 #include "base/sha1.h" |
| 13 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
14 #include "base/strings/string_number_conversions.h" | |
15 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
16 #include "base/time.h" | 16 #include "base/time/time.h" |
17 #include "net/disk_cache/simple/simple_entry_format.h" | 17 #include "net/disk_cache/simple/simple_entry_format.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Size of the uint64 hash_key number in Hex format in a string. | 21 // Size of the uint64 hash_key number in Hex format in a string. |
22 const size_t kEntryHashKeyAsHexStringSize = 2 * sizeof(uint64); | 22 const size_t kEntryHashKeyAsHexStringSize = 2 * sizeof(uint64); |
23 | 23 |
24 // TODO(clamy, gavinp): this should go in base | 24 // TODO(clamy, gavinp): this should go in base |
25 bool GetNanoSecsFromStat(const struct stat& st, | 25 bool GetNanoSecsFromStat(const struct stat& st, |
26 time_t* out_sec, | 26 time_t* out_sec, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 base::PlatformFileInfo file_info; | 124 base::PlatformFileInfo file_info; |
125 if (!file_util::GetFileInfo(path, &file_info)) | 125 if (!file_util::GetFileInfo(path, &file_info)) |
126 return false; | 126 return false; |
127 *out_mtime = file_info.last_modified; | 127 *out_mtime = file_info.last_modified; |
128 return true; | 128 return true; |
129 } | 129 } |
130 | 130 |
131 } // namespace simple_backend | 131 } // namespace simple_backend |
132 | 132 |
133 } // namespace disk_cache | 133 } // namespace disk_cache |
OLD | NEW |