| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/nacl/nacl_thread.h" | 5 #include "chrome/nacl/nacl_thread.h" |
| 6 | 6 |
| 7 #include <vector> |
| 8 |
| 7 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
| 8 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 9 #include "chrome/common/notification_service.h" | |
| 10 #include "chrome/common/nacl_messages.h" | 11 #include "chrome/common/nacl_messages.h" |
| 11 #include "native_client/src/shared/imc/nacl_imc.h" | 12 #include "native_client/src/shared/imc/nacl_imc.h" |
| 12 | 13 |
| 13 #if defined(OS_LINUX) | 14 #if defined(OS_LINUX) |
| 14 #include "chrome/renderer/renderer_sandbox_support_linux.h" | 15 #include "chrome/renderer/renderer_sandbox_support_linux.h" |
| 15 #endif | 16 #endif |
| 16 | 17 |
| 17 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 LOG(ERROR) << "write() failed: " << errno; | 41 LOG(ERROR) << "write() failed: " << errno; |
| 41 return -1; | 42 return -1; |
| 42 } | 43 } |
| 43 return result_fd; | 44 return result_fd; |
| 44 } | 45 } |
| 45 } | 46 } |
| 46 // Fall back to NaCl's default implementation. | 47 // Fall back to NaCl's default implementation. |
| 47 return -1; | 48 return -1; |
| 48 } | 49 } |
| 49 | 50 |
| 50 } | 51 } // namespace |
| 51 #endif | 52 #endif // defined(OS_MACOSX) |
| 52 | 53 |
| 53 // This is ugly. We need an interface header file for the exported | 54 // This is ugly. We need an interface header file for the exported |
| 54 // sel_ldr interfaces. | 55 // sel_ldr interfaces. |
| 55 // TODO(gregoryd,sehr): Add an interface header. | 56 // TODO(gregoryd,sehr): Add an interface header. |
| 56 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
| 57 typedef HANDLE NaClHandle; | 58 typedef HANDLE NaClHandle; |
| 58 #else | 59 #else |
| 59 typedef int NaClHandle; | 60 typedef int NaClHandle; |
| 60 #endif // NaClHandle | 61 #endif // NaClHandle |
| 61 | 62 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]); | 92 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]); |
| 92 handles.pop_back(); | 93 handles.pop_back(); |
| 93 #endif | 94 #endif |
| 94 scoped_array<NaClHandle> array(new NaClHandle[handles.size()]); | 95 scoped_array<NaClHandle> array(new NaClHandle[handles.size()]); |
| 95 for (size_t i = 0; i < handles.size(); i++) { | 96 for (size_t i = 0; i < handles.size(); i++) { |
| 96 array[i] = nacl::ToNativeHandle(handles[i]); | 97 array[i] = nacl::ToNativeHandle(handles[i]); |
| 97 } | 98 } |
| 98 NaClMainForChromium(static_cast<int>(handles.size()), array.get(), | 99 NaClMainForChromium(static_cast<int>(handles.size()), array.get(), |
| 99 debug_enabled_); | 100 debug_enabled_); |
| 100 } | 101 } |
| OLD | NEW |