Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Side by Side Diff: net/disk_cache/simple/simple_util.cc

Issue 22571011: Remove simple_util::GetMTime from simple cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/simple/simple_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return data_size + key.size() + sizeof(SimpleFileHeader) + 78 return data_size + key.size() + sizeof(SimpleFileHeader) +
79 sizeof(SimpleFileEOF); 79 sizeof(SimpleFileEOF);
80 } 80 }
81 81
82 int64 GetFileOffsetFromKeyAndDataOffset(const std::string& key, 82 int64 GetFileOffsetFromKeyAndDataOffset(const std::string& key,
83 int data_offset) { 83 int data_offset) {
84 const int64 headers_size = sizeof(disk_cache::SimpleFileHeader) + key.size(); 84 const int64 headers_size = sizeof(disk_cache::SimpleFileHeader) + key.size();
85 return headers_size + data_offset; 85 return headers_size + data_offset;
86 } 86 }
87 87
88 // TODO(clamy, gavinp): this should go in base 88 } // namespace simple_util
89 bool GetMTime(const base::FilePath& path, base::Time* out_mtime) {
90 DCHECK(out_mtime);
91 base::PlatformFileInfo file_info;
92 if (!file_util::GetFileInfo(path, &file_info))
93 return false;
94 *out_mtime = file_info.last_modified;
95 return true;
96 }
97
98 } // namespace simple_backend
99 89
100 } // namespace disk_cache 90 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698