Index: chrome/browser/profiles/file_path_verifier_win.cc |
diff --git a/chrome/browser/profiles/file_path_verifier_win.cc b/chrome/browser/profiles/file_path_verifier_win.cc |
index 44d34a435bd3da2e652174c078940e8640151a0e..cdf5b8d9981e5dca3e4b83a54fe7c43c353897ba 100644 |
--- a/chrome/browser/profiles/file_path_verifier_win.cc |
+++ b/chrome/browser/profiles/file_path_verifier_win.cc |
@@ -9,6 +9,7 @@ |
#include "base/file_util.h" |
#include "base/files/file_path.h" |
#include "base/metrics/histogram.h" |
+#include "chrome_elf/create_file/chrome_create_file.h" |
namespace { |
@@ -20,6 +21,9 @@ enum FileVerificationResult { |
FILE_VERIFICATION_FAILED_UNKNOWN, |
FILE_VERIFICATION_FAILED_SAMEBASE, |
FILE_VERIFICATION_FAILED_SAMEDIR, |
+ FILE_VERIFICATION_SUCCESS_REDIRECT, |
+ FILE_VERIFICATION_FAILED_SAMEBASE_REDIRECT, |
+ FILE_VERIFICATION_FAILED_SAMEDIR_REDIRECT, |
NUM_FILE_VERIFICATION_RESULTS |
}; |
@@ -28,6 +32,7 @@ FileVerificationResult VerifyFileAtPath(const base::FilePath& file) { |
FileVerificationResult file_verification_result = |
FILE_VERIFICATION_FAILED_UNKNOWN; |
base::FilePath normalized_path; |
+ int redirect_count_before = ::GetRedirectCount(); |
robertshield
2014/02/18 23:30:21
Sorry for not noticing this earlier, this won't ca
Cait (Slow)
2014/02/19 15:43:18
As discussed w/Robert -- I think we're ok here sin
gab
2014/02/19 15:43:40
chrome_elf methods are statically linked in chrome
robertshield
2014/02/19 16:17:02
This was a brain fart on my part. For some reason
|
if (!base::NormalizeFilePath(file, &normalized_path)) { |
if (::GetLastError() == ERROR_FILE_NOT_FOUND) |
file_verification_result = FILE_VERIFICATION_FILE_NOT_FOUND; |
@@ -36,15 +41,21 @@ FileVerificationResult VerifyFileAtPath(const base::FilePath& file) { |
} else { |
internal::PathComparisonReason path_comparison_reason = |
internal::ComparePathsIgnoreCase(file, normalized_path); |
+ bool was_redirected = ::GetRedirectCount() > redirect_count_before; |
switch (path_comparison_reason) { |
case internal::PATH_COMPARISON_EQUAL: |
- file_verification_result = FILE_VERIFICATION_SUCCESS; |
+ file_verification_result = was_redirected ? |
+ FILE_VERIFICATION_SUCCESS_REDIRECT : FILE_VERIFICATION_SUCCESS; |
break; |
case internal::PATH_COMPARISON_FAILED_SAMEBASE: |
- file_verification_result = FILE_VERIFICATION_FAILED_SAMEBASE; |
+ file_verification_result = was_redirected ? |
+ FILE_VERIFICATION_FAILED_SAMEBASE_REDIRECT : |
+ FILE_VERIFICATION_FAILED_SAMEBASE; |
break; |
case internal::PATH_COMPARISON_FAILED_SAMEDIR: |
- file_verification_result = FILE_VERIFICATION_FAILED_SAMEDIR; |
+ file_verification_result = was_redirected ? |
+ FILE_VERIFICATION_FAILED_SAMEDIR_REDIRECT : |
+ FILE_VERIFICATION_FAILED_SAMEDIR; |
break; |
} |
} |