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

Side by Side Diff: content/browser/renderer_host/sandbox_ipc_linux.cc

Issue 1146813011: Move UnixDomainSocket to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/sandbox_ipc_linux.h" 5 #include "content/browser/renderer_host/sandbox_ipc_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/poll.h> 8 #include <sys/poll.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 void SandboxIPCHandler::HandleRequestFromRenderer(int fd) { 125 void SandboxIPCHandler::HandleRequestFromRenderer(int fd) {
126 ScopedVector<base::ScopedFD> fds; 126 ScopedVector<base::ScopedFD> fds;
127 127
128 // A FontConfigIPC::METHOD_MATCH message could be kMaxFontFamilyLength 128 // A FontConfigIPC::METHOD_MATCH message could be kMaxFontFamilyLength
129 // bytes long (this is the largest message type). 129 // bytes long (this is the largest message type).
130 // 128 bytes padding are necessary so recvmsg() does not return MSG_TRUNC 130 // 128 bytes padding are necessary so recvmsg() does not return MSG_TRUNC
131 // error for a maximum length message. 131 // error for a maximum length message.
132 char buf[FontConfigIPC::kMaxFontFamilyLength + 128]; 132 char buf[FontConfigIPC::kMaxFontFamilyLength + 128];
133 133
134 const ssize_t len = UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds); 134 const ssize_t len =
135 base::UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds);
135 if (len == -1) { 136 if (len == -1) {
136 // TODO: should send an error reply, or the sender might block forever. 137 // TODO: should send an error reply, or the sender might block forever.
137 NOTREACHED() << "Sandbox host message is larger than kMaxFontFamilyLength"; 138 NOTREACHED() << "Sandbox host message is larger than kMaxFontFamilyLength";
138 return; 139 return;
139 } 140 }
140 if (fds.empty()) 141 if (fds.empty())
141 return; 142 return;
142 143
143 Pickle pickle(buf, len); 144 Pickle pickle(buf, len);
144 PickleIterator iter(pickle); 145 PickleIterator iter(pickle);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 } 444 }
444 445
445 void SandboxIPCHandler::EnsureWebKitInitialized() { 446 void SandboxIPCHandler::EnsureWebKitInitialized() {
446 if (blink_platform_impl_) 447 if (blink_platform_impl_)
447 return; 448 return;
448 blink_platform_impl_.reset(new BlinkPlatformImpl); 449 blink_platform_impl_.reset(new BlinkPlatformImpl);
449 blink::initializeWithoutV8(blink_platform_impl_.get()); 450 blink::initializeWithoutV8(blink_platform_impl_.get());
450 } 451 }
451 452
452 } // namespace content 453 } // namespace content
OLDNEW
« no previous file with comments | « components/nacl/zygote/nacl_fork_delegate_linux.cc ('k') | content/browser/zygote_host/zygote_host_impl_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698