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

Unified Diff: sandbox/linux/syscall_broker/broker_host.cc

Issue 1508213002: Replace ScopedVector<ScopedFD> with std::vector<ScopedFD> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: danakj feedback Created 5 years 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/linux/integration_tests/namespace_unix_domain_socket_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/syscall_broker/broker_host.cc
diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc
index 1a0568fb2f0458ecfd5567544a631808abef8406..a81a30e694442e691259e5d25826ad8901075a33 100644
--- a/sandbox/linux/syscall_broker/broker_host.cc
+++ b/sandbox/linux/syscall_broker/broker_host.cc
@@ -174,7 +174,7 @@ BrokerHost::~BrokerHost() {
// that we will then close.
// A request should start with an int that will be used as the command type.
BrokerHost::RequestStatus BrokerHost::HandleRequest() const {
- ScopedVector<base::ScopedFD> fds;
+ std::vector<base::ScopedFD> fds;
char buf[kMaxMessageLength];
errno = 0;
const ssize_t msg_len = base::UnixDomainSocket::RecvMsg(
@@ -187,13 +187,12 @@ BrokerHost::RequestStatus BrokerHost::HandleRequest() const {
// The client should send exactly one file descriptor, on which we
// will write the reply.
- // TODO(mdempsky): ScopedVector doesn't have 'at()', only 'operator[]'.
- if (msg_len < 0 || fds.size() != 1 || fds[0]->get() < 0) {
+ if (msg_len < 0 || fds.size() != 1 || fds[0].get() < 0) {
PLOG(ERROR) << "Error reading message from the client";
return RequestStatus::FAILURE;
}
- base::ScopedFD temporary_ipc(std::move(*fds[0]));
+ base::ScopedFD temporary_ipc(std::move(fds[0]));
base::Pickle pickle(buf, msg_len);
base::PickleIterator iter(pickle);
« no previous file with comments | « sandbox/linux/integration_tests/namespace_unix_domain_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698