| 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/common/child_process_sandbox_support_impl_linux.h" | 5 #include "content/common/child_process_sandbox_support_impl_linux.h" |
| 6 | 6 |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/numerics/safe_conversions.h" | 11 #include "base/numerics/safe_conversions.h" |
| 12 #include "base/pickle.h" | 12 #include "base/pickle.h" |
| 13 #include "base/posix/eintr_wrapper.h" | 13 #include "base/posix/eintr_wrapper.h" |
| 14 #include "base/posix/unix_domain_socket_linux.h" | 14 #include "base/posix/unix_domain_socket_linux.h" |
| 15 #include "base/sys_byteorder.h" | 15 #include "base/sys_byteorder.h" |
| 16 #include "content/common/sandbox_linux/sandbox_linux.h" | 16 #include "content/common/sandbox_linux/sandbox_linux.h" |
| 17 #include "content/common/zygote_commands_linux.h" |
| 17 #include "third_party/WebKit/public/platform/linux/WebFontFamily.h" | 18 #include "third_party/WebKit/public/platform/linux/WebFontFamily.h" |
| 18 #include "third_party/WebKit/public/platform/linux/WebFontRenderStyle.h" | 19 #include "third_party/WebKit/public/platform/linux/WebFontRenderStyle.h" |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 void GetFontFamilyForCharacter(int32_t character, | 23 void GetFontFamilyForCharacter(int32_t character, |
| 23 const char* preferred_locale, | 24 const char* preferred_locale, |
| 24 blink::WebFontFamily* family) { | 25 blink::WebFontFamily* family) { |
| 25 TRACE_EVENT0("sandbox_ipc", "GetFontFamilyForCharacter"); | 26 TRACE_EVENT0("sandbox_ipc", "GetFontFamilyForCharacter"); |
| 26 | 27 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 data_length = std::min(data_length, *output_length); | 175 data_length = std::min(data_length, *output_length); |
| 175 ssize_t n = HANDLE_EINTR(pread(fd, output, data_length, data_offset)); | 176 ssize_t n = HANDLE_EINTR(pread(fd, output, data_length, data_offset)); |
| 176 if (n != base::checked_cast<ssize_t>(data_length)) | 177 if (n != base::checked_cast<ssize_t>(data_length)) |
| 177 return false; | 178 return false; |
| 178 } | 179 } |
| 179 *output_length = data_length; | 180 *output_length = data_length; |
| 180 | 181 |
| 181 return true; | 182 return true; |
| 182 } | 183 } |
| 183 | 184 |
| 185 bool SendZygoteChildPing(int fd) { |
| 186 return UnixDomainSocket::SendMsg(fd, |
| 187 kZygoteChildPingMessage, |
| 188 sizeof(kZygoteChildPingMessage), |
| 189 std::vector<int>()); |
| 190 } |
| 191 |
| 184 } // namespace content | 192 } // namespace content |
| OLD | NEW |