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

Side by Side Diff: content/browser/utility_process_host_impl.cc

Issue 1643533006: Use a single, generic, global zygote to temporarily resolve perf regressions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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 #include "content/browser/utility_process_host_impl.h" 5 #include "content/browser/utility_process_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 exposed_files.value().c_str()); 97 exposed_files.value().c_str());
98 return result == sandbox::SBOX_ALL_OK; 98 return result == sandbox::SBOX_ALL_OK;
99 } 99 }
100 100
101 #elif defined(OS_POSIX) 101 #elif defined(OS_POSIX)
102 102
103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
104 ZygoteHandle* GetZygote() override { 104 ZygoteHandle* GetZygote() override {
105 if (no_sandbox_ || !exposed_dir_.empty()) 105 if (no_sandbox_ || !exposed_dir_.empty())
106 return nullptr; 106 return nullptr;
107 return &g_utility_zygote; 107 static ZygoteHandle zygote = GetGenericZygote();
108 return &zygote;
108 } 109 }
109 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) 110 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
110 base::EnvironmentMap GetEnvironment() override { return env_; } 111 base::EnvironmentMap GetEnvironment() override { return env_; }
111 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } 112 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
112 #endif // OS_WIN 113 #endif // OS_WIN
113 114
114 SandboxType GetSandboxType() override { 115 SandboxType GetSandboxType() override {
115 return SANDBOX_TYPE_UTILITY; 116 return SANDBOX_TYPE_UTILITY;
116 } 117 }
117 118
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 if (RenderProcessHost::run_renderer_in_process()) 398 if (RenderProcessHost::run_renderer_in_process())
398 handle = base::GetCurrentProcessHandle(); 399 handle = base::GetCurrentProcessHandle();
399 else 400 else
400 handle = process_->GetData().handle; 401 handle = process_->GetData().handle;
401 402
402 mojo_application_host_->Activate(this, handle); 403 mojo_application_host_->Activate(this, handle);
403 } 404 }
404 } 405 }
405 406
406 } // namespace content 407 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698