OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // http://code.google.com/p/chromium/wiki/LinuxSandboxIPC | 5 // http://code.google.com/p/chromium/wiki/LinuxSandboxIPC |
6 | 6 |
7 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ | 7 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ |
8 #define CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ | 8 #define CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ |
9 | 9 |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
11 #include "base/thread.h" | 11 #include "base/thread.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 | 13 |
14 // This is a singleton object which handles sandbox requests from the | 14 // This is a singleton object which handles sandbox requests from the |
15 // renderers. | 15 // renderers. |
16 class RenderSandboxHostLinux { | 16 class RenderSandboxHostLinux { |
17 public: | 17 public: |
18 // Get the file descriptor which renderers should be given in order to signal | 18 // Get the file descriptor which renderers should be given in order to signal |
19 // crashes to the browser. | 19 // crashes to the browser. |
20 int GetRendererSocket() const { return renderer_socket_; } | 20 int GetRendererSocket() const { return renderer_socket_; } |
| 21 pid_t pid() const { return pid_; } |
21 | 22 |
22 private: | 23 private: |
23 friend struct DefaultSingletonTraits<RenderSandboxHostLinux>; | 24 friend struct DefaultSingletonTraits<RenderSandboxHostLinux>; |
24 // This object must be constructed on the main thread. | 25 // This object must be constructed on the main thread. |
25 RenderSandboxHostLinux(); | 26 RenderSandboxHostLinux(); |
26 ~RenderSandboxHostLinux(); | 27 ~RenderSandboxHostLinux(); |
27 | 28 |
28 int renderer_socket_; | 29 int renderer_socket_; |
29 int childs_lifeline_fd_; | 30 int childs_lifeline_fd_; |
| 31 pid_t pid_; |
30 | 32 |
31 DISALLOW_EVIL_CONSTRUCTORS(RenderSandboxHostLinux); | 33 DISALLOW_EVIL_CONSTRUCTORS(RenderSandboxHostLinux); |
32 }; | 34 }; |
33 | 35 |
34 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ | 36 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_ |
OLD | NEW |