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

Unified Diff: chrome_elf/create_file/chrome_create_file.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: Rebase 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
« no previous file with comments | « chrome_elf/create_file/chrome_create_file.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/create_file/chrome_create_file.cc
diff --git a/chrome_elf/create_file/chrome_create_file.cc b/chrome_elf/create_file/chrome_create_file.cc
index 6bb2c78abc7db1efaddbb1fe1937b7adb0304195..1b8515fb9f786fb2847d5d8c015a8bce9602090e 100644
--- a/chrome_elf/create_file/chrome_create_file.cc
+++ b/chrome_elf/create_file/chrome_create_file.cc
@@ -44,6 +44,9 @@ PathIsPrefixFunction g_path_is_prefix_func;
PathFindFileName g_path_find_filename_func;
SHGetFolderPathFunction g_get_folder_func;
+// Record the number of calls we've redirected so far.
+int g_redirect_count = 0;
+
// Populates the g_*_func pointers to functions which will be used in
// ShouldBypass(). Chrome_elf cannot have a load-time dependency on shell32 or
// shlwapi as this would induce a load-time dependency on user32.dll. Instead,
@@ -93,6 +96,7 @@ HANDLE WINAPI CreateFileWRedirect(
DWORD flags_and_attributes,
HANDLE template_file) {
if (ShouldBypass(file_name)) {
+ ++g_redirect_count;
return CreateFileNTDLL(file_name,
desired_access,
share_mode,
@@ -111,6 +115,10 @@ HANDLE WINAPI CreateFileWRedirect(
}
+int GetRedirectCount() {
+ return g_redirect_count;
+}
+
HANDLE CreateFileNTDLL(
LPCWSTR file_name,
DWORD desired_access,
« no previous file with comments | « chrome_elf/create_file/chrome_create_file.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698