OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 Pickle reply; | 365 Pickle reply; |
366 reply.WriteInt(pid); | 366 reply.WriteInt(pid); |
367 SendRendererReply(fds, reply, -1); | 367 SendRendererReply(fds, reply, -1); |
368 } | 368 } |
369 | 369 |
370 void HandleMakeSharedMemorySegment(int fd, const Pickle& pickle, void* iter, | 370 void HandleMakeSharedMemorySegment(int fd, const Pickle& pickle, void* iter, |
371 std::vector<int>& fds) { | 371 std::vector<int>& fds) { |
372 uint32_t shm_size; | 372 uint32_t shm_size; |
373 if (!pickle.ReadUInt32(&iter, &shm_size)) | 373 if (!pickle.ReadUInt32(&iter, &shm_size)) |
374 return; | 374 return; |
| 375 bool executable; |
| 376 if (!pickle.ReadBool(&iter, &executable)) |
| 377 return; |
375 int shm_fd = -1; | 378 int shm_fd = -1; |
376 base::SharedMemory shm; | 379 base::SharedMemory shm; |
377 if (shm.CreateAnonymous(shm_size)) | 380 if (shm.CreateAnonymous(shm_size, executable)) |
378 shm_fd = shm.handle().fd; | 381 shm_fd = shm.handle().fd; |
379 Pickle reply; | 382 Pickle reply; |
380 SendRendererReply(fds, reply, shm_fd); | 383 SendRendererReply(fds, reply, shm_fd); |
381 } | 384 } |
382 | 385 |
383 void HandleMatchWithFallback(int fd, const Pickle& pickle, void* iter, | 386 void HandleMatchWithFallback(int fd, const Pickle& pickle, void* iter, |
384 std::vector<int>& fds) { | 387 std::vector<int>& fds) { |
385 // Unlike the other calls, for which we are an indirection in front of | 388 // Unlike the other calls, for which we are an indirection in front of |
386 // WebKit or Skia, this call is always made via this sandbox helper | 389 // WebKit or Skia, this call is always made via this sandbox helper |
387 // process. Therefore the fontconfig code goes in here directly. | 390 // process. Therefore the fontconfig code goes in here directly. |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 } | 715 } |
713 | 716 |
714 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 717 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
715 if (initialized_) { | 718 if (initialized_) { |
716 if (HANDLE_EINTR(close(renderer_socket_)) < 0) | 719 if (HANDLE_EINTR(close(renderer_socket_)) < 0) |
717 PLOG(ERROR) << "close"; | 720 PLOG(ERROR) << "close"; |
718 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) | 721 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) |
719 PLOG(ERROR) << "close"; | 722 PLOG(ERROR) << "close"; |
720 } | 723 } |
721 } | 724 } |
OLD | NEW |