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

Unified Diff: sandbox/win/tests/common/controller.cc

Issue 1320783002: Make SharedMemoryHandle a class on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_global
Patch Set: Rebase. Created 5 years, 3 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 | « sandbox/win/src/policy_target_test.cc ('k') | ui/gfx/blit_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/tests/common/controller.cc
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc
index 4f90fb4f051798b80638b6ab512d550c130c5b2b..8d3e29dd9600bf643b55cdc46b01d2fe89a70baa 100644
--- a/sandbox/win/tests/common/controller.cc
+++ b/sandbox/win/tests/common/controller.cc
@@ -8,6 +8,7 @@
#include "base/memory/shared_memory.h"
#include "base/process/process.h"
+#include "base/process/process_handle.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "base/win/windows_version.h"
@@ -304,11 +305,12 @@ int DispatchCall(int argc, wchar_t **argv) {
// If the caller shared a shared memory handle with us attempt to open it
// in read only mode and sleep infinitely if we succeed.
if (0 == _wcsicmp(argv[3], L"shared_memory_handle")) {
- base::SharedMemoryHandle shared_handle = NULL;
- base::StringToUint(
- argv[4], reinterpret_cast<unsigned int*>(&shared_handle));
- if (shared_handle == NULL)
+ HANDLE raw_handle = nullptr;
+ base::StringToUint(argv[4], reinterpret_cast<unsigned int*>(&raw_handle));
+ if (raw_handle == nullptr)
return SBOX_TEST_INVALID_PARAMETER;
+ base::SharedMemoryHandle shared_handle(raw_handle,
+ base::GetCurrentProcId());
base::SharedMemory read_only_view(shared_handle, true);
if (!read_only_view.Map(0))
return SBOX_TEST_INVALID_PARAMETER;
« no previous file with comments | « sandbox/win/src/policy_target_test.cc ('k') | ui/gfx/blit_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698