Chromium Code Reviews| 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 #ifndef CONTENT_COMMON_ZYGOTE_COMMANDS_LINUX_H_ | 5 #ifndef CONTENT_COMMON_ZYGOTE_COMMANDS_LINUX_H_ |
| 6 #define CONTENT_COMMON_ZYGOTE_COMMANDS_LINUX_H_ | 6 #define CONTENT_COMMON_ZYGOTE_COMMANDS_LINUX_H_ |
| 7 | 7 |
| 8 #include "base/posix/global_descriptors.h" | 8 #include "base/posix/global_descriptors.h" |
| 9 #include "ipc/ipc_descriptors.h" | 9 #include "ipc/ipc_descriptors.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 // Contents of the initial message sent from the zygote to the browser right | 13 // Contents of the initial message sent from the zygote to the browser right |
| 14 // after it starts. | 14 // after it starts. |
| 15 static const char kZygoteBootMessage[] = "ZYGOTE_BOOT"; | 15 static const char kZygoteBootMessage[] = "ZYGOTE_BOOT"; |
| 16 | 16 |
| 17 // Contents of the initial message sent from the zygote to the browser when it | 17 // Contents of the initial message sent from the zygote to the browser when it |
| 18 // is ready to go. | 18 // is ready to go. |
| 19 static const char kZygoteHelloMessage[] = "ZYGOTE_OK"; | 19 static const char kZygoteHelloMessage[] = "ZYGOTE_OK"; |
| 20 | 20 |
| 21 // Message sent by zygote children to the browser so it can discover their | |
|
Mark Seaborn
2014/05/06 23:34:13
Nit: to disambiguate -- "so the browser can discov
mdempsky
2014/05/07 05:39:25
Done.
| |
| 22 // process ID. | |
| 23 static const char kZygoteChildPingMessage[] = "CHILD_PING"; | |
| 24 | |
| 21 // Maximum allowable length for messages sent to the zygote. | 25 // Maximum allowable length for messages sent to the zygote. |
| 22 const size_t kZygoteMaxMessageLength = 8192; | 26 const size_t kZygoteMaxMessageLength = 8192; |
| 23 | 27 |
| 24 // File descriptors initialized by the Zygote Host | 28 // File descriptors initialized by the Zygote Host |
| 25 const int kZygoteSocketPairFd = | 29 const int kZygoteSocketPairFd = |
| 26 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor; | 30 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor; |
| 27 | 31 |
| 28 // These are the command codes used on the wire between the browser and the | 32 // These are the command codes used on the wire between the browser and the |
| 29 // zygote. | 33 // zygote. |
| 30 enum { | 34 enum { |
| 31 // Fork off a new renderer. | 35 // Fork off a new renderer. |
| 32 kZygoteCommandFork = 0, | 36 kZygoteCommandFork = 0, |
| 33 | 37 |
| 34 // Reap a renderer child. | 38 // Reap a renderer child. |
| 35 kZygoteCommandReap = 1, | 39 kZygoteCommandReap = 1, |
| 36 | 40 |
| 37 // Check what happened to a child process. | 41 // Check what happened to a child process. |
| 38 kZygoteCommandGetTerminationStatus = 2, | 42 kZygoteCommandGetTerminationStatus = 2, |
| 39 | 43 |
| 40 // Read a bitmask of kSandboxLinux* | 44 // Read a bitmask of kSandboxLinux* |
| 41 kZygoteCommandGetSandboxStatus = 3 | 45 kZygoteCommandGetSandboxStatus = 3, |
| 46 | |
| 47 // Not a real zygote command, but a subcommand used during the zygote fork | |
| 48 // protocol. Sends the child's PID as seen from the browser process. | |
| 49 kZygoteCommandForkRealPID = 4 | |
| 42 }; | 50 }; |
| 43 | 51 |
| 44 } // namespace content | 52 } // namespace content |
| 45 | 53 |
| 46 #endif // CONTENT_COMMON_ZYGOTE_COMMANDS_LINUX_H_ | 54 #endif // CONTENT_COMMON_ZYGOTE_COMMANDS_LINUX_H_ |
| OLD | NEW |