summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 22:55:42 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 22:55:42 +0000
commit61823d7c768d2559c32446dfedc196b8785e3144 (patch)
tree8ed710cdeb7ea534ff3f154120be54989cc7c0a1 /sandbox
parent3f2ec4481badd5b07a009f26340fb10af6473bfd (diff)
downloadchromium_src-61823d7c768d2559c32446dfedc196b8785e3144.zip
chromium_src-61823d7c768d2559c32446dfedc196b8785e3144.tar.gz
chromium_src-61823d7c768d2559c32446dfedc196b8785e3144.tar.bz2
Make HandleCloserAgent walk in 4x multiples on x64
Unfortunately, there's no non-flakey way to test this, because we can't control handle allocation. BUG=397130 R=wfh@chromium.org NOTRY=true Review URL: https://codereview.chromium.org/419533003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/win/src/handle_closer_agent.cc2
-rw-r--r--sandbox/win/src/handle_closer_test.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/sandbox/win/src/handle_closer_agent.cc b/sandbox/win/src/handle_closer_agent.cc
index be0ffc1..07c6a09 100644
--- a/sandbox/win/src/handle_closer_agent.cc
+++ b/sandbox/win/src/handle_closer_agent.cc
@@ -78,7 +78,7 @@ void HandleCloserAgent::InitializeHandlesToClose() {
bool HandleCloserAgent::CloseHandles() {
DWORD handle_count = UINT_MAX;
const int kInvalidHandleThreshold = 100;
- const size_t kHandleOffset = sizeof(HANDLE);
+ const size_t kHandleOffset = 4; // Handles are always a multiple of 4.
if (!::GetProcessHandleCount(::GetCurrentProcess(), &handle_count))
return false;
diff --git a/sandbox/win/src/handle_closer_test.cc b/sandbox/win/src/handle_closer_test.cc
index 8e821ce..2082baa 100644
--- a/sandbox/win/src/handle_closer_test.cc
+++ b/sandbox/win/src/handle_closer_test.cc
@@ -73,7 +73,7 @@ SBOX_TESTS_COMMAND int CheckForFileHandles(int argc, wchar_t **argv) {
// Brute force the handle table to find what we're looking for.
DWORD handle_count = UINT_MAX;
const int kInvalidHandleThreshold = 100;
- const size_t kHandleOffset = sizeof(HANDLE);
+ const size_t kHandleOffset = 4; // Handles are always a multiple of 4.
HANDLE handle = NULL;
int invalid_count = 0;
base::string16 handle_name;