| 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 "chrome/common/notification_service.h" | 7 #include "chrome/common/notification_service.h" |
| 8 #include "chrome/common/nacl_messages.h" | 8 #include "chrome/common/nacl_messages.h" |
| 9 | 9 |
| 10 // This is ugly. We need an interface header file for the exported | 10 // This is ugly. We need an interface header file for the exported |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 NaClThread* NaClThread::current() { | 29 NaClThread* NaClThread::current() { |
| 30 return static_cast<NaClThread*>(ChildThread::current()); | 30 return static_cast<NaClThread*>(ChildThread::current()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void NaClThread::OnControlMessageReceived(const IPC::Message& msg) { | 33 void NaClThread::OnControlMessageReceived(const IPC::Message& msg) { |
| 34 IPC_BEGIN_MESSAGE_MAP(NaClThread, msg) | 34 IPC_BEGIN_MESSAGE_MAP(NaClThread, msg) |
| 35 IPC_MESSAGE_HANDLER(NaClProcessMsg_Start, OnStartSelLdr) | 35 IPC_MESSAGE_HANDLER(NaClProcessMsg_Start, OnStartSelLdr) |
| 36 IPC_END_MESSAGE_MAP() | 36 IPC_END_MESSAGE_MAP() |
| 37 } | 37 } |
| 38 | 38 |
| 39 void NaClThread::OnStartSelLdr(int channel_descriptor, | 39 void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) { |
| 40 nacl::FileDescriptor handle) { | 40 NaClHandle* array = new NaClHandle[handles.size()]; |
| 41 NaClHandle nacl_handle = nacl::ToNativeHandle(handle); | 41 for (size_t i = 0; i < handles.size(); i++) { |
| 42 NaClMainForChromium(/* handle_count= */ 1, &nacl_handle); | 42 array[i] = nacl::ToNativeHandle(handles[i]); |
| 43 } |
| 44 NaClMainForChromium(static_cast<int>(handles.size()), array); |
| 45 delete array; |
| 43 } | 46 } |
| OLD | NEW |