OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_sandbox_host_linux.h" | 5 #include "chrome/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> |
11 #include <sys/uio.h> | 11 #include <sys/uio.h> |
12 #include <sys/stat.h> | 12 #include <sys/stat.h> |
13 #include <sys/socket.h> | 13 #include <sys/socket.h> |
14 #include <sys/poll.h> | 14 #include <sys/poll.h> |
15 #include <time.h> | 15 #include <time.h> |
16 | 16 |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/eintr_wrapper.h" | 20 #include "base/eintr_wrapper.h" |
21 #include "base/linux_util.h" | 21 #include "base/linux_util.h" |
22 #include "base/pickle.h" | 22 #include "base/pickle.h" |
23 #include "base/process_util.h" | 23 #include "base/process_util.h" |
24 #include "base/scoped_ptr.h" | 24 #include "base/scoped_ptr.h" |
25 #include "base/shared_memory.h" | 25 #include "base/shared_memory.h" |
| 26 #include "base/string_number_conversions.h" |
26 #include "base/string_util.h" | 27 #include "base/string_util.h" |
27 #include "base/unix_domain_socket_posix.h" | 28 #include "base/unix_domain_socket_posix.h" |
28 #include "chrome/common/sandbox_methods_linux.h" | 29 #include "chrome/common/sandbox_methods_linux.h" |
29 #include "third_party/npapi/bindings/npapi_extensions.h" | 30 #include "third_party/npapi/bindings/npapi_extensions.h" |
30 #include "third_party/WebKit/WebKit/chromium/public/gtk/WebFontInfo.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/gtk/WebFontInfo.h" |
31 | 32 |
32 #include "SkFontHost_fontconfig_direct.h" | 33 #include "SkFontHost_fontconfig_direct.h" |
33 #include "SkFontHost_fontconfig_ipc.h" | 34 #include "SkFontHost_fontconfig_ipc.h" |
34 | 35 |
35 using WebKit::WebCString; | 36 using WebKit::WebCString; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 330 } |
330 | 331 |
331 uint64_t inode; | 332 uint64_t inode; |
332 if (!pickle.ReadUInt64(&iter, &inode)) | 333 if (!pickle.ReadUInt64(&iter, &inode)) |
333 return; | 334 return; |
334 | 335 |
335 base::ProcessId pid = 0; | 336 base::ProcessId pid = 0; |
336 std::string inode_output; | 337 std::string inode_output; |
337 | 338 |
338 std::vector<std::string> sandbox_cmd = sandbox_cmd_; | 339 std::vector<std::string> sandbox_cmd = sandbox_cmd_; |
339 sandbox_cmd.push_back(Int64ToString(inode)); | 340 sandbox_cmd.push_back(base::Int64ToString(inode)); |
340 CommandLine get_inode_cmd(sandbox_cmd); | 341 CommandLine get_inode_cmd(sandbox_cmd); |
341 if (base::GetAppOutput(get_inode_cmd, &inode_output)) | 342 if (base::GetAppOutput(get_inode_cmd, &inode_output)) |
342 StringToInt(inode_output, &pid); | 343 StringToInt(inode_output, &pid); |
343 | 344 |
344 if (!pid) { | 345 if (!pid) { |
345 LOG(ERROR) << "Could not get pid"; | 346 LOG(ERROR) << "Could not get pid"; |
346 return; | 347 return; |
347 } | 348 } |
348 | 349 |
349 Pickle reply; | 350 Pickle reply; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 } | 667 } |
667 | 668 |
668 RenderSandboxHostLinux::~RenderSandboxHostLinux() { | 669 RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
669 if (init_) { | 670 if (init_) { |
670 if (HANDLE_EINTR(close(renderer_socket_)) < 0) | 671 if (HANDLE_EINTR(close(renderer_socket_)) < 0) |
671 PLOG(ERROR) << "close"; | 672 PLOG(ERROR) << "close"; |
672 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) | 673 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) |
673 PLOG(ERROR) << "close"; | 674 PLOG(ERROR) << "close"; |
674 } | 675 } |
675 } | 676 } |
OLD | NEW |