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

Unified Diff: mojo/edk/system/channel_win.cc

Issue 2008953003: [mojo-edk] Explicitly serialise HANDLEs into messages instead of PlatformHandles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove handles accessor Created 4 years, 7 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: mojo/edk/system/channel_win.cc
diff --git a/mojo/edk/system/channel_win.cc b/mojo/edk/system/channel_win.cc
index 38744ab99b16e424daf497b24695fc17469c1e0b..cbd9a3c2c28788f79da02881222d64dce0f703f9 100644
--- a/mojo/edk/system/channel_win.cc
+++ b/mojo/edk/system/channel_win.cc
@@ -121,12 +121,15 @@ class ChannelWin : public Channel,
ScopedPlatformHandleVectorPtr* handles) override {
if (num_handles > std::numeric_limits<uint16_t>::max())
return false;
- size_t handles_size = sizeof(PlatformHandle) * num_handles;
+ size_t handles_size = sizeof(HANDLE) * num_handles;
if (handles_size > extra_header_size)
return false;
DCHECK(extra_header);
handles->reset(new PlatformHandleVector(num_handles));
- memcpy((*handles)->data(), extra_header, handles_size);
+ const HANDLE* extra_header_handles =
+ reinterpret_cast<const HANDLE*>(extra_header);
+ for (size_t i = 0; i < num_handles; i++)
+ (*handles)->at(i).handle = extra_header_handles[i];
return true;
}

Powered by Google App Engine
This is Rietveld 408576698