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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 scoped_refptr<RewrittenMessage> rewritten_msg(new RewrittenMessage); | 656 scoped_refptr<RewrittenMessage> rewritten_msg(new RewrittenMessage); |
657 rewritten_msg->AddDescriptor(desc_wrapper.release()); | 657 rewritten_msg->AddDescriptor(desc_wrapper.release()); |
658 { | 658 { |
659 base::AutoLock lock(lock_); | 659 base::AutoLock lock(lock_); |
660 SaveMessage(*new_msg, rewritten_msg.get()); | 660 SaveMessage(*new_msg, rewritten_msg.get()); |
661 cond_var_.Signal(); | 661 cond_var_.Signal(); |
662 } | 662 } |
663 return; | 663 return; |
664 } | 664 } |
665 | 665 |
666 // The file token was sucessfully resolved. | 666 // The file token was successfully resolved. |
667 std::string file_path_str = file_path.AsUTF8Unsafe(); | 667 std::string file_path_str = file_path.AsUTF8Unsafe(); |
668 base::PlatformFile handle = | 668 base::PlatformFile handle = |
669 IPC::PlatformFileForTransitToPlatformFile(ipc_fd); | 669 IPC::PlatformFileForTransitToPlatformFile(ipc_fd); |
670 | 670 |
671 ppapi::proxy::SerializedHandle sh; | 671 ppapi::proxy::SerializedHandle sh; |
672 sh.set_file_handle(ipc_fd, PP_FILEOPENFLAG_READ, 0); | 672 sh.set_file_handle(ipc_fd, PP_FILEOPENFLAG_READ, 0); |
673 scoped_ptr<IPC::Message> new_msg = CreateOpenResourceReply(orig_msg, sh); | 673 scoped_ptr<IPC::Message> new_msg = CreateOpenResourceReply(orig_msg, sh); |
674 scoped_refptr<RewrittenMessage> rewritten_msg(new RewrittenMessage); | 674 scoped_refptr<RewrittenMessage> rewritten_msg(new RewrittenMessage); |
675 | 675 |
676 struct NaClDesc* desc = | 676 struct NaClDesc* desc = |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 header.flags = msg.flags(); | 827 header.flags = msg.flags(); |
828 header.num_fds = static_cast<uint16>(rewritten_msg->desc_count()); | 828 header.num_fds = static_cast<uint16>(rewritten_msg->desc_count()); |
829 | 829 |
830 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); | 830 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); |
831 locked_data_.to_be_received_.push(rewritten_msg); | 831 locked_data_.to_be_received_.push(rewritten_msg); |
832 } | 832 } |
833 | 833 |
834 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { | 834 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { |
835 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); | 835 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); |
836 } | 836 } |
OLD | NEW |