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

Unified Diff: mojo/embedder/platform_channel_utils_posix.cc

Issue 292983007: Mojo: Make PlatformChannelRecvmsg() append handles to a deque instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 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
« no previous file with comments | « mojo/embedder/platform_channel_utils_posix.h ('k') | mojo/embedder/platform_handle_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/embedder/platform_channel_utils_posix.cc
diff --git a/mojo/embedder/platform_channel_utils_posix.cc b/mojo/embedder/platform_channel_utils_posix.cc
index ec5ef591f2dba3a182e8bad2ada2ce35f0ced177..7dba371bcf181fdc4391b6a6f15bf28af4ffcb5c 100644
--- a/mojo/embedder/platform_channel_utils_posix.cc
+++ b/mojo/embedder/platform_channel_utils_posix.cc
@@ -105,10 +105,10 @@ bool PlatformChannelSendHandles(PlatformHandle h,
ssize_t PlatformChannelRecvmsg(PlatformHandle h,
void* buf,
size_t num_bytes,
- ScopedPlatformHandleVectorPtr* handles) {
+ std::deque<PlatformHandle>* platform_handles) {
DCHECK(buf);
DCHECK_GT(num_bytes, 0u);
- DCHECK(handles);
+ DCHECK(platform_handles);
struct iovec iov = { buf, num_bytes };
char cmsg_buf[CMSG_SPACE(kPlatformChannelMaxNumHandles * sizeof(int))];
@@ -137,10 +137,8 @@ ssize_t PlatformChannelRecvmsg(PlatformHandle h,
size_t num_fds = payload_length / sizeof(int);
const int* fds = reinterpret_cast<int*>(CMSG_DATA(cmsg));
for (size_t i = 0; i < num_fds; i++) {
- if (!*handles)
- (*handles).reset(new PlatformHandleVector());
- (*handles)->push_back(PlatformHandle(fds[i]));
- DCHECK((*handles)->back().is_valid());
+ platform_handles->push_back(PlatformHandle(fds[i]));
+ DCHECK(platform_handles->back().is_valid());
}
}
}
« no previous file with comments | « mojo/embedder/platform_channel_utils_posix.h ('k') | mojo/embedder/platform_handle_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698