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 <memory> | 10 #include <memory> |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 new_msg->set_reply(); | 619 new_msg->set_reply(); |
620 new_msg->WriteInt(IPC::SyncMessage::GetMessageId(orig_msg)); | 620 new_msg->WriteInt(IPC::SyncMessage::GetMessageId(orig_msg)); |
621 | 621 |
622 // Write empty file tokens. | 622 // Write empty file tokens. |
623 new_msg->WriteUInt64(0); // token_lo | 623 new_msg->WriteUInt64(0); // token_lo |
624 new_msg->WriteUInt64(0); // token_hi | 624 new_msg->WriteUInt64(0); // token_hi |
625 | 625 |
626 ppapi::proxy::SerializedHandle::WriteHeader(sh.header(), | 626 ppapi::proxy::SerializedHandle::WriteHeader(sh.header(), |
627 new_msg.get()); | 627 new_msg.get()); |
628 new_msg->WriteBool(true); // valid == true | 628 new_msg->WriteBool(true); // valid == true |
629 new_msg->WriteBool(false); // brokerable == false | |
630 // The file descriptor is at index 0. There's only ever one file | 629 // The file descriptor is at index 0. There's only ever one file |
631 // descriptor provided for this message type, so this will be correct. | 630 // descriptor provided for this message type, so this will be correct. |
632 new_msg->WriteInt(0); | 631 new_msg->WriteInt(0); |
633 | 632 |
634 return new_msg; | 633 return new_msg; |
635 } | 634 } |
636 | 635 |
637 void NaClIPCAdapter::SaveOpenResourceMessage( | 636 void NaClIPCAdapter::SaveOpenResourceMessage( |
638 const IPC::Message& orig_msg, | 637 const IPC::Message& orig_msg, |
639 IPC::PlatformFileForTransit ipc_fd, | 638 IPC::PlatformFileForTransit ipc_fd, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 header.flags = msg.flags(); | 841 header.flags = msg.flags(); |
843 header.num_fds = static_cast<uint16_t>(rewritten_msg->desc_count()); | 842 header.num_fds = static_cast<uint16_t>(rewritten_msg->desc_count()); |
844 | 843 |
845 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); | 844 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); |
846 locked_data_.to_be_received_.push(rewritten_msg); | 845 locked_data_.to_be_received_.push(rewritten_msg); |
847 } | 846 } |
848 | 847 |
849 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { | 848 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { |
850 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); | 849 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); |
851 } | 850 } |
OLD | NEW |