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

Side by Side Diff: chrome/installer/util/duplicate_tree_detector.cc

Issue 101143006: Convert base::file_util to use File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove base:: Created 6 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 5
6 #include "chrome/installer/util/duplicate_tree_detector.h" 6 #include "chrome/installer/util/duplicate_tree_detector.h"
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 11
12 namespace installer { 12 namespace installer {
13 13
14 bool IsIdenticalFileHierarchy(const base::FilePath& src_path, 14 bool IsIdenticalFileHierarchy(const base::FilePath& src_path,
15 const base::FilePath& dest_path) { 15 const base::FilePath& dest_path) {
16 base::PlatformFileInfo src_info; 16 base::File::Info src_info;
17 base::PlatformFileInfo dest_info; 17 base::File::Info dest_info;
18 18
19 bool is_identical = false; 19 bool is_identical = false;
20 if (base::GetFileInfo(src_path, &src_info) && 20 if (base::GetFileInfo(src_path, &src_info) &&
21 base::GetFileInfo(dest_path, &dest_info)) { 21 base::GetFileInfo(dest_path, &dest_info)) {
22 // Both paths exist, check the types: 22 // Both paths exist, check the types:
23 if (!src_info.is_directory && !dest_info.is_directory) { 23 if (!src_info.is_directory && !dest_info.is_directory) {
24 // Two files are "identical" if the file sizes are equivalent. 24 // Two files are "identical" if the file sizes are equivalent.
25 is_identical = src_info.size == dest_info.size; 25 is_identical = src_info.size == dest_info.size;
26 #ifndef NDEBUG 26 #ifndef NDEBUG
27 // For Debug builds, also check last modification time (to make sure 27 // For Debug builds, also check last modification time (to make sure
(...skipping 18 matching lines...) Expand all
46 } else { 46 } else {
47 // The two paths are of different types, so they cannot be identical. 47 // The two paths are of different types, so they cannot be identical.
48 DCHECK(!is_identical); 48 DCHECK(!is_identical);
49 } 49 }
50 } 50 }
51 51
52 return is_identical; 52 return is_identical;
53 } 53 }
54 54
55 } // namespace installer 55 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_unittest.cc ('k') | chrome/installer/util/install_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698