| 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" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return false; | 118 return false; |
| 119 time_t sec; | 119 time_t sec; |
| 120 long nsec; | 120 long nsec; |
| 121 if (GetNanoSecsFromStat(file_stat, &sec, &nsec)) { | 121 if (GetNanoSecsFromStat(file_stat, &sec, &nsec)) { |
| 122 int64 usec = (nsec / base::Time::kNanosecondsPerMicrosecond); | 122 int64 usec = (nsec / base::Time::kNanosecondsPerMicrosecond); |
| 123 *out_mtime = base::Time::FromTimeT(sec) | 123 *out_mtime = base::Time::FromTimeT(sec) |
| 124 + base::TimeDelta::FromMicroseconds(usec); | 124 + base::TimeDelta::FromMicroseconds(usec); |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| 127 #endif | 127 #endif |
| 128 base::PlatformFileInfo file_info; | 128 base::File::Info file_info; |
| 129 if (!base::GetFileInfo(path, &file_info)) | 129 if (!base::GetFileInfo(path, &file_info)) |
| 130 return false; | 130 return false; |
| 131 *out_mtime = file_info.last_modified; | 131 *out_mtime = file_info.last_modified; |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace simple_backend | 135 } // namespace simple_backend |
| 136 | 136 |
| 137 } // namespace disk_cache | 137 } // namespace disk_cache |
| OLD | NEW |