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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 int id = IPC::SyncMessage::GetMessageId(*message.get()); | 792 int id = IPC::SyncMessage::GetMessageId(*message.get()); |
793 DCHECK(io_thread_data_.pending_sync_msgs_.find(id) == | 793 DCHECK(io_thread_data_.pending_sync_msgs_.find(id) == |
794 io_thread_data_.pending_sync_msgs_.end()); | 794 io_thread_data_.pending_sync_msgs_.end()); |
795 | 795 |
796 // Handle PpapiHostMsg_OpenResource locally without sending an IPC to the | 796 // Handle PpapiHostMsg_OpenResource locally without sending an IPC to the |
797 // renderer when possible. | 797 // renderer when possible. |
798 PpapiHostMsg_OpenResource::Schema::SendParam send_params; | 798 PpapiHostMsg_OpenResource::Schema::SendParam send_params; |
799 if (!open_resource_cb_.is_null() && | 799 if (!open_resource_cb_.is_null() && |
800 message->type() == PpapiHostMsg_OpenResource::ID && | 800 message->type() == PpapiHostMsg_OpenResource::ID && |
801 PpapiHostMsg_OpenResource::ReadSendParam(message.get(), &send_params)) { | 801 PpapiHostMsg_OpenResource::ReadSendParam(message.get(), &send_params)) { |
802 const std::string key = get<0>(send_params); | 802 const std::string key = base::get<0>(send_params); |
803 // Both open_resource_cb_ and SaveOpenResourceMessage must be invoked | 803 // Both open_resource_cb_ and SaveOpenResourceMessage must be invoked |
804 // from the I/O thread. | 804 // from the I/O thread. |
805 if (open_resource_cb_.Run( | 805 if (open_resource_cb_.Run( |
806 *message.get(), key, | 806 *message.get(), key, |
807 base::Bind(&NaClIPCAdapter::SaveOpenResourceMessage, this))) { | 807 base::Bind(&NaClIPCAdapter::SaveOpenResourceMessage, this))) { |
808 // The callback sent a reply to the untrusted side. | 808 // The callback sent a reply to the untrusted side. |
809 return; | 809 return; |
810 } | 810 } |
811 } | 811 } |
812 | 812 |
(...skipping 17 matching lines...) Expand all Loading... |
830 header.flags = msg.flags(); | 830 header.flags = msg.flags(); |
831 header.num_fds = static_cast<uint16>(rewritten_msg->desc_count()); | 831 header.num_fds = static_cast<uint16>(rewritten_msg->desc_count()); |
832 | 832 |
833 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); | 833 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); |
834 locked_data_.to_be_received_.push(rewritten_msg); | 834 locked_data_.to_be_received_.push(rewritten_msg); |
835 } | 835 } |
836 | 836 |
837 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { | 837 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { |
838 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); | 838 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); |
839 } | 839 } |
OLD | NEW |