OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_sandbox_host_linux.h" | 5 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <fontconfig/fontconfig.h> | 8 #include <fontconfig/fontconfig.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 Pickle reply; | 385 Pickle reply; |
386 reply.WriteInt(pid); | 386 reply.WriteInt(pid); |
387 SendRendererReply(fds, reply, -1); | 387 SendRendererReply(fds, reply, -1); |
388 } | 388 } |
389 | 389 |
390 void HandleMakeSharedMemorySegment(int fd, const Pickle& pickle, | 390 void HandleMakeSharedMemorySegment(int fd, const Pickle& pickle, |
391 PickleIterator iter, | 391 PickleIterator iter, |
392 std::vector<int>& fds) { | 392 std::vector<int>& fds) { |
393 base::SharedMemoryCreateOptions options; | 393 base::SharedMemoryCreateOptions options; |
394 if (!pickle.ReadUInt32(&iter, &options.size)) | 394 uint32_t size; |
| 395 if (!pickle.ReadUInt32(&iter, &size)) |
395 return; | 396 return; |
| 397 options.size = size; |
396 if (!pickle.ReadBool(&iter, &options.executable)) | 398 if (!pickle.ReadBool(&iter, &options.executable)) |
397 return; | 399 return; |
398 int shm_fd = -1; | 400 int shm_fd = -1; |
399 base::SharedMemory shm; | 401 base::SharedMemory shm; |
400 if (shm.Create(options)) | 402 if (shm.Create(options)) |
401 shm_fd = shm.handle().fd; | 403 shm_fd = shm.handle().fd; |
402 Pickle reply; | 404 Pickle reply; |
403 SendRendererReply(fds, reply, shm_fd); | 405 SendRendererReply(fds, reply, shm_fd); |
404 } | 406 } |
405 | 407 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 745 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
744 if (initialized_) { | 746 if (initialized_) { |
745 if (HANDLE_EINTR(close(renderer_socket_)) < 0) | 747 if (HANDLE_EINTR(close(renderer_socket_)) < 0) |
746 PLOG(ERROR) << "close"; | 748 PLOG(ERROR) << "close"; |
747 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) | 749 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) |
748 PLOG(ERROR) << "close"; | 750 PLOG(ERROR) << "close"; |
749 } | 751 } |
750 } | 752 } |
751 | 753 |
752 } // namespace content | 754 } // namespace content |
OLD | NEW |