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

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

Issue 1340683002: Remove base's implicit_cast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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_index_file.h" 5 #include "net/disk_cache/simple/simple_index_file.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 bool WritePickleFile(base::Pickle* pickle, const base::FilePath& file_name) { 71 bool WritePickleFile(base::Pickle* pickle, const base::FilePath& file_name) {
72 File file( 72 File file(
73 file_name, 73 file_name,
74 File::FLAG_CREATE | File::FLAG_WRITE | File::FLAG_SHARE_DELETE); 74 File::FLAG_CREATE | File::FLAG_WRITE | File::FLAG_SHARE_DELETE);
75 if (!file.IsValid()) 75 if (!file.IsValid())
76 return false; 76 return false;
77 77
78 int bytes_written = 78 int bytes_written =
79 file.Write(0, static_cast<const char*>(pickle->data()), pickle->size()); 79 file.Write(0, static_cast<const char*>(pickle->data()), pickle->size());
80 if (bytes_written != implicit_cast<int>(pickle->size())) { 80 if (bytes_written != static_cast<int>(pickle->size())) {
81 simple_util::SimpleCacheDeleteFile(file_name); 81 simple_util::SimpleCacheDeleteFile(file_name);
82 return false; 82 return false;
83 } 83 }
84 return true; 84 return true;
85 } 85 }
86 86
87 // Called for each cache directory traversal iteration. 87 // Called for each cache directory traversal iteration.
88 void ProcessEntryFile(SimpleIndex::EntrySet* entries, 88 void ProcessEntryFile(SimpleIndex::EntrySet* entries,
89 const base::FilePath& file_path) { 89 const base::FilePath& file_path) {
90 static const size_t kEntryFilesLength = 90 static const size_t kEntryFilesLength =
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 bool SimpleIndexFile::LegacyIsIndexFileStale( 474 bool SimpleIndexFile::LegacyIsIndexFileStale(
475 base::Time cache_last_modified, 475 base::Time cache_last_modified,
476 const base::FilePath& index_file_path) { 476 const base::FilePath& index_file_path) {
477 base::Time index_mtime; 477 base::Time index_mtime;
478 if (!simple_util::GetMTime(index_file_path, &index_mtime)) 478 if (!simple_util::GetMTime(index_file_path, &index_mtime))
479 return true; 479 return true;
480 return index_mtime < cache_last_modified; 480 return index_mtime < cache_last_modified;
481 } 481 }
482 482
483 } // namespace disk_cache 483 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698