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

Side by Side Diff: chrome/browser/profiles/file_path_verifier_win.cc

Issue 102873002: Move GetFileSize, NormalizeFilePath to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/profiles/file_path_verifier_win.h" 5 #include "chrome/browser/profiles/file_path_verifier_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 10 matching lines...) Expand all
21 FILE_VERIFICATION_FAILED_SAMEBASE, 21 FILE_VERIFICATION_FAILED_SAMEBASE,
22 FILE_VERIFICATION_FAILED_SAMEDIR, 22 FILE_VERIFICATION_FAILED_SAMEDIR,
23 NUM_FILE_VERIFICATION_RESULTS 23 NUM_FILE_VERIFICATION_RESULTS
24 }; 24 };
25 25
26 // Returns a FileVerificationResult based on the state of |file| on disk. 26 // Returns a FileVerificationResult based on the state of |file| on disk.
27 FileVerificationResult VerifyFileAtPath(const base::FilePath& file) { 27 FileVerificationResult VerifyFileAtPath(const base::FilePath& file) {
28 FileVerificationResult file_verification_result = 28 FileVerificationResult file_verification_result =
29 FILE_VERIFICATION_FAILED_UNKNOWN; 29 FILE_VERIFICATION_FAILED_UNKNOWN;
30 base::FilePath normalized_path; 30 base::FilePath normalized_path;
31 if (!file_util::NormalizeFilePath(file, &normalized_path)) { 31 if (!base::NormalizeFilePath(file, &normalized_path)) {
32 if (::GetLastError() == ERROR_FILE_NOT_FOUND) 32 if (::GetLastError() == ERROR_FILE_NOT_FOUND)
33 file_verification_result = FILE_VERIFICATION_FILE_NOT_FOUND; 33 file_verification_result = FILE_VERIFICATION_FILE_NOT_FOUND;
34 else 34 else
35 file_verification_result = FILE_VERIFICATION_INTERNAL_ERROR; 35 file_verification_result = FILE_VERIFICATION_INTERNAL_ERROR;
36 } else { 36 } else {
37 internal::PathComparisonReason path_comparison_reason = 37 internal::PathComparisonReason path_comparison_reason =
38 internal::ComparePathsIgnoreCase(file, normalized_path); 38 internal::ComparePathsIgnoreCase(file, normalized_path);
39 switch (path_comparison_reason) { 39 switch (path_comparison_reason) {
40 case internal::PATH_COMPARISON_EQUAL: 40 case internal::PATH_COMPARISON_EQUAL:
41 file_verification_result = FILE_VERIFICATION_SUCCESS; 41 file_verification_result = FILE_VERIFICATION_SUCCESS;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 } // namespace internal 75 } // namespace internal
76 76
77 void VerifyPreferencesFile(const base::FilePath& pref_file_path) { 77 void VerifyPreferencesFile(const base::FilePath& pref_file_path) {
78 FileVerificationResult file_verification_result = 78 FileVerificationResult file_verification_result =
79 VerifyFileAtPath(pref_file_path); 79 VerifyFileAtPath(pref_file_path);
80 UMA_HISTOGRAM_ENUMERATION("Stability.FileAtPath.Preferences", 80 UMA_HISTOGRAM_ENUMERATION("Stability.FileAtPath.Preferences",
81 file_verification_result, 81 file_verification_result,
82 NUM_FILE_VERIFICATION_RESULTS); 82 NUM_FILE_VERIFICATION_RESULTS);
83 } 83 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_dialog_cloud.cc ('k') | chrome/browser/safe_browsing/prefix_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698