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

Side by Side Diff: components/nacl/browser/nacl_process_host.cc

Issue 1532423003: Have each SandboxedProcessLauncherDelegate maintain a zygote. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fetch sandbox status Created 5 years 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 "components/nacl/browser/nacl_process_host.h" 5 #include "components/nacl/browser/nacl_process_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // from .dll loading. The NaCl process will attempt to locate this space by 172 // from .dll loading. The NaCl process will attempt to locate this space by
173 // scanning the address space using VirtualQuery. 173 // scanning the address space using VirtualQuery.
174 // TODO(bbudge) Handle the --no-sandbox case. 174 // TODO(bbudge) Handle the --no-sandbox case.
175 // http://code.google.com/p/nativeclient/issues/detail?id=2131 175 // http://code.google.com/p/nativeclient/issues/detail?id=2131
176 const SIZE_T kNaClSandboxSize = 1 << 30; 176 const SIZE_T kNaClSandboxSize = 1 << 30;
177 if (!nacl::AllocateAddressSpaceASLR(process, kNaClSandboxSize)) { 177 if (!nacl::AllocateAddressSpaceASLR(process, kNaClSandboxSize)) {
178 DLOG(WARNING) << "Failed to reserve address space for Native Client"; 178 DLOG(WARNING) << "Failed to reserve address space for Native Client";
179 } 179 }
180 } 180 }
181 #elif defined(OS_POSIX) 181 #elif defined(OS_POSIX)
182 bool ShouldUseZygote() override { return true; } 182 content::ZygoteHandle* GetZygote() override {
183 static content::ZygoteHandle zygote;
184 return &zygote;
185 }
183 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } 186 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
184 #endif // OS_WIN 187 #endif // OS_WIN
185 188
186 private: 189 private:
187 #if defined(OS_POSIX) 190 #if defined(OS_POSIX)
188 base::ScopedFD ipc_fd_; 191 base::ScopedFD ipc_fd_;
189 #endif // OS_POSIX 192 #endif // OS_POSIX
190 }; 193 };
191 194
192 void SetCloseOnExec(NaClHandle fd) { 195 void SetCloseOnExec(NaClHandle fd) {
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 NaClStartDebugExceptionHandlerThread( 1379 NaClStartDebugExceptionHandlerThread(
1377 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), 1380 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(),
1378 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, 1381 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
1379 weak_factory_.GetWeakPtr())); 1382 weak_factory_.GetWeakPtr()));
1380 return true; 1383 return true;
1381 } 1384 }
1382 } 1385 }
1383 #endif 1386 #endif
1384 1387
1385 } // namespace nacl 1388 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698