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 #ifndef CHROME_BROWSER_ZYGOTE_HOST_LINUX_H_ | 5 #ifndef CHROME_BROWSER_ZYGOTE_HOST_LINUX_H_ |
6 #define CHROME_BROWSER_ZYGOTE_HOST_LINUX_H_ | 6 #define CHROME_BROWSER_ZYGOTE_HOST_LINUX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include <unistd.h> |
| 12 |
11 #include "base/global_descriptors_posix.h" | 13 #include "base/global_descriptors_posix.h" |
12 #include "base/process.h" | 14 #include "base/process.h" |
13 | 15 |
14 template<typename Type> | 16 template<typename Type> |
15 struct DefaultSingletonTraits; | 17 struct DefaultSingletonTraits; |
16 | 18 |
17 // http://code.google.com/p/chromium/wiki/LinuxZygote | 19 // http://code.google.com/p/chromium/wiki/LinuxZygote |
18 | 20 |
19 // The zygote host is the interface, in the browser process, to the zygote | 21 // The zygote host is the interface, in the browser process, to the zygote |
20 // process. | 22 // process. |
(...skipping 11 matching lines...) Expand all Loading... |
32 bool DidProcessCrash(base::ProcessHandle handle, bool* child_exited); | 34 bool DidProcessCrash(base::ProcessHandle handle, bool* child_exited); |
33 | 35 |
34 // These are the command codes used on the wire between the browser and the | 36 // These are the command codes used on the wire between the browser and the |
35 // zygote. | 37 // zygote. |
36 enum { | 38 enum { |
37 kCmdFork = 0, // Fork off a new renderer. | 39 kCmdFork = 0, // Fork off a new renderer. |
38 kCmdReap = 1, // Reap a renderer child. | 40 kCmdReap = 1, // Reap a renderer child. |
39 kCmdDidProcessCrash = 2, // Check if child process crashed. | 41 kCmdDidProcessCrash = 2, // Check if child process crashed. |
40 }; | 42 }; |
41 | 43 |
| 44 pid_t pid() const { return pid_; } |
| 45 |
42 private: | 46 private: |
43 friend struct DefaultSingletonTraits<ZygoteHost>; | 47 friend struct DefaultSingletonTraits<ZygoteHost>; |
44 ZygoteHost(); | 48 ZygoteHost(); |
45 void LaunchZygoteProcess(); | 49 void LaunchZygoteProcess(); |
46 | 50 |
47 int control_fd_; // the socket to the zygote | 51 int control_fd_; // the socket to the zygote |
| 52 pid_t pid_; |
48 }; | 53 }; |
49 | 54 |
50 #endif // CHROME_BROWSER_ZYGOTE_HOST_LINUX_H_ | 55 #endif // CHROME_BROWSER_ZYGOTE_HOST_LINUX_H_ |
OLD | NEW |