| 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 #include "components/nacl/browser/nacl_process_host.h" | 5 #include "components/nacl/browser/nacl_process_host.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // scanning the address space using VirtualQuery. | 179 // scanning the address space using VirtualQuery. |
| 180 // TODO(bbudge) Handle the --no-sandbox case. | 180 // TODO(bbudge) Handle the --no-sandbox case. |
| 181 // http://code.google.com/p/nativeclient/issues/detail?id=2131 | 181 // http://code.google.com/p/nativeclient/issues/detail?id=2131 |
| 182 const SIZE_T kNaClSandboxSize = 1 << 30; | 182 const SIZE_T kNaClSandboxSize = 1 << 30; |
| 183 if (!nacl::AllocateAddressSpaceASLR(process, kNaClSandboxSize)) { | 183 if (!nacl::AllocateAddressSpaceASLR(process, kNaClSandboxSize)) { |
| 184 DLOG(WARNING) << "Failed to reserve address space for Native Client"; | 184 DLOG(WARNING) << "Failed to reserve address space for Native Client"; |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 #elif defined(OS_POSIX) | 187 #elif defined(OS_POSIX) |
| 188 #if !defined(OS_MACOSX) | 188 #if !defined(OS_MACOSX) |
| 189 content::ZygoteHandle* GetZygote() override { return &g_nacl_zygote; } | 189 content::ZygoteHandle* GetZygote() override { |
| 190 static content::ZygoteHandle zygote = content::GetGenericZygote(); |
| 191 return &zygote; |
| 192 } |
| 190 #endif // !defined(OS_MACOSX) | 193 #endif // !defined(OS_MACOSX) |
| 191 | 194 |
| 192 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } | 195 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } |
| 193 #endif // OS_WIN | 196 #endif // OS_WIN |
| 194 | 197 |
| 195 private: | 198 private: |
| 196 #if defined(OS_POSIX) | 199 #if defined(OS_POSIX) |
| 197 base::ScopedFD ipc_fd_; | 200 base::ScopedFD ipc_fd_; |
| 198 #endif // OS_POSIX | 201 #endif // OS_POSIX |
| 199 }; | 202 }; |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 NaClStartDebugExceptionHandlerThread( | 1333 NaClStartDebugExceptionHandlerThread( |
| 1331 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), | 1334 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), |
| 1332 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1335 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 1333 weak_factory_.GetWeakPtr())); | 1336 weak_factory_.GetWeakPtr())); |
| 1334 return true; | 1337 return true; |
| 1335 } | 1338 } |
| 1336 } | 1339 } |
| 1337 #endif | 1340 #endif |
| 1338 | 1341 |
| 1339 } // namespace nacl | 1342 } // namespace nacl |
| OLD | NEW |