Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1852)

Unified Diff: content/zygote/zygote_linux.cc

Issue 23956010: Define magic descriptors in one place. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/zygote/zygote_linux.cc
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index 4b83444929b4807b2414a4d0b0ba9e4b572ae923..f1a0452e3e7f2f30779394269f29ef2964ecdccc 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -42,8 +42,6 @@ void SIGCHLDHandler(int signal) {
} // namespace
-const int Zygote::kMagicSandboxIPCDescriptor;
-
Zygote::Zygote(int sandbox_flags,
ZygoteForkDelegate* helper)
: sandbox_flags_(sandbox_flags),
@@ -77,7 +75,7 @@ bool Zygote::ProcessRequests() {
// Let the ZygoteHost know we are ready to go.
// The receiving code is in content/browser/zygote_host_linux.cc.
std::vector<int> empty;
- bool r = UnixDomainSocket::SendMsg(kBrowserDescriptor,
+ bool r = UnixDomainSocket::SendMsg(kMagicZygoteDescriptor,
kZygoteHelloMessage,
sizeof(kZygoteHelloMessage), empty);
#if defined(OS_CHROMEOS)
@@ -94,7 +92,7 @@ bool Zygote::ProcessRequests() {
for (;;) {
// This function call can return multiple times, once per fork().
- if (HandleRequestFromBrowser(kBrowserDescriptor))
+ if (HandleRequestFromBrowser(kMagicZygoteDescriptor))
return true;
}
}
@@ -475,7 +473,7 @@ base::ProcessId Zygote::ReadArgsAndFork(const Pickle& pickle,
if (!child_pid) {
// This is the child process.
- close(kBrowserDescriptor); // Our socket from the browser.
+ close(kMagicZygoteDescriptor); // Our socket from the browser.
if (UsingSUIDSandbox())
close(kZygoteIdFd); // Another socket from the browser.
base::GlobalDescriptors::GetInstance()->Reset(mapping);

Powered by Google App Engine
This is Rietveld 408576698