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

Side by Side Diff: chrome/nacl/nacl_thread.cc

Issue 2832093: NaCl: Allow setting up multiple sockets for subprocess instead of just one (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Whitespace fixes Created 10 years, 4 months 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) 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698