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

Unified Diff: chrome/browser/profiles/file_path_verifier_win.cc

Issue 169093007: Modify fileAtPath stat to track if the call was redirected by chrome_elf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move counter to anonymous namespace Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
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,
gab 2014/02/19 15:43:40 Also update the enum in histograms.xml to include
Cait (Slow) 2014/02/19 16:28:06 Done.
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();
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;
}
}

Powered by Google App Engine
This is Rietveld 408576698