| 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 <algorithm> | 7 #include <algorithm> | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 169     // from .dll loading. The NaCl process will attempt to locate this space by | 169     // from .dll loading. The NaCl process will attempt to locate this space by | 
| 170     // scanning the address space using VirtualQuery. | 170     // scanning the address space using VirtualQuery. | 
| 171     // TODO(bbudge) Handle the --no-sandbox case. | 171     // TODO(bbudge) Handle the --no-sandbox case. | 
| 172     // http://code.google.com/p/nativeclient/issues/detail?id=2131 | 172     // http://code.google.com/p/nativeclient/issues/detail?id=2131 | 
| 173     const SIZE_T kNaClSandboxSize = 1 << 30; | 173     const SIZE_T kNaClSandboxSize = 1 << 30; | 
| 174     if (!nacl::AllocateAddressSpaceASLR(process, kNaClSandboxSize)) { | 174     if (!nacl::AllocateAddressSpaceASLR(process, kNaClSandboxSize)) { | 
| 175       DLOG(WARNING) << "Failed to reserve address space for Native Client"; | 175       DLOG(WARNING) << "Failed to reserve address space for Native Client"; | 
| 176     } | 176     } | 
| 177   } | 177   } | 
| 178 #elif defined(OS_POSIX) | 178 #elif defined(OS_POSIX) | 
| 179   virtual bool ShouldUseZygote() OVERRIDE { | 179   virtual bool ShouldUseZygote() override { | 
| 180     return true; | 180     return true; | 
| 181   } | 181   } | 
| 182   virtual int GetIpcFd() OVERRIDE { | 182   virtual int GetIpcFd() override { | 
| 183     return ipc_fd_; | 183     return ipc_fd_; | 
| 184   } | 184   } | 
| 185 #endif  // OS_WIN | 185 #endif  // OS_WIN | 
| 186 | 186 | 
| 187  private: | 187  private: | 
| 188 #if defined(OS_POSIX) | 188 #if defined(OS_POSIX) | 
| 189   int ipc_fd_; | 189   int ipc_fd_; | 
| 190 #endif  // OS_POSIX | 190 #endif  // OS_POSIX | 
| 191 }; | 191 }; | 
| 192 | 192 | 
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1194         process_handle.Take(), info, | 1194         process_handle.Take(), info, | 
| 1195         base::MessageLoopProxy::current(), | 1195         base::MessageLoopProxy::current(), | 
| 1196         base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1196         base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 
| 1197                    weak_factory_.GetWeakPtr())); | 1197                    weak_factory_.GetWeakPtr())); | 
| 1198     return true; | 1198     return true; | 
| 1199   } | 1199   } | 
| 1200 } | 1200 } | 
| 1201 #endif | 1201 #endif | 
| 1202 | 1202 | 
| 1203 }  // namespace nacl | 1203 }  // namespace nacl | 
| OLD | NEW | 
|---|