OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/loader/nacl_ipc_adapter.h" | 5 #include "components/nacl/loader/nacl_ipc_adapter.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 scoped_refptr<NaClIPCAdapter> ipc_adapter( | 514 scoped_refptr<NaClIPCAdapter> ipc_adapter( |
515 new NaClIPCAdapter(channel_handle, task_runner_.get())); | 515 new NaClIPCAdapter(channel_handle, task_runner_.get())); |
516 ipc_adapter->ConnectChannel(); | 516 ipc_adapter->ConnectChannel(); |
517 #if defined(OS_POSIX) | 517 #if defined(OS_POSIX) |
518 channel_handle.socket = base::FileDescriptor( | 518 channel_handle.socket = base::FileDescriptor( |
519 ipc_adapter->TakeClientFileDescriptor(), true); | 519 ipc_adapter->TakeClientFileDescriptor(), true); |
520 #endif | 520 #endif |
521 nacl_desc.reset(new NaClDescWrapper(ipc_adapter->MakeNaClDesc())); | 521 nacl_desc.reset(new NaClDescWrapper(ipc_adapter->MakeNaClDesc())); |
522 // Send back a message that the channel was created. | 522 // Send back a message that the channel was created. |
523 scoped_ptr<IPC::Message> response( | 523 scoped_ptr<IPC::Message> response( |
524 new PpapiHostMsg_ChannelCreated(channel_handle)); | 524 new PpapiHostMsg_NaClChannelCreated(channel_handle)); |
525 task_runner_->PostTask(FROM_HERE, | 525 task_runner_->PostTask(FROM_HERE, |
526 base::Bind(&NaClIPCAdapter::SendMessageOnIOThread, this, | 526 base::Bind(&NaClIPCAdapter::SendMessageOnIOThread, this, |
527 base::Passed(&response))); | 527 base::Passed(&response))); |
528 break; | 528 break; |
529 } | 529 } |
530 case ppapi::proxy::SerializedHandle::FILE: { | 530 case ppapi::proxy::SerializedHandle::FILE: { |
531 // Create the NaClDesc for the file descriptor. If quota checking is | 531 // Create the NaClDesc for the file descriptor. If quota checking is |
532 // required, wrap it in a NaClDescQuota. | 532 // required, wrap it in a NaClDescQuota. |
533 NaClDesc* desc = NaClDescIoDescFromHandleAllocCtor( | 533 NaClDesc* desc = NaClDescIoDescFromHandleAllocCtor( |
534 #if defined(OS_WIN) | 534 #if defined(OS_WIN) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 header.flags = msg.flags(); | 687 header.flags = msg.flags(); |
688 header.num_fds = static_cast<int>(rewritten_msg->desc_count()); | 688 header.num_fds = static_cast<int>(rewritten_msg->desc_count()); |
689 | 689 |
690 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); | 690 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); |
691 locked_data_.to_be_received_.push(rewritten_msg); | 691 locked_data_.to_be_received_.push(rewritten_msg); |
692 } | 692 } |
693 | 693 |
694 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { | 694 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { |
695 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); | 695 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); |
696 } | 696 } |
OLD | NEW |