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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 NaClIPCAdapter::LockedData::~LockedData() { | 318 NaClIPCAdapter::LockedData::~LockedData() { |
319 } | 319 } |
320 | 320 |
321 NaClIPCAdapter::IOThreadData::IOThreadData() { | 321 NaClIPCAdapter::IOThreadData::IOThreadData() { |
322 } | 322 } |
323 | 323 |
324 NaClIPCAdapter::IOThreadData::~IOThreadData() { | 324 NaClIPCAdapter::IOThreadData::~IOThreadData() { |
325 } | 325 } |
326 | 326 |
327 NaClIPCAdapter::NaClIPCAdapter(const IPC::ChannelHandle& handle, | 327 NaClIPCAdapter::NaClIPCAdapter(const IPC::ChannelHandle& handle, |
328 base::TaskRunner* runner) | 328 base::TaskRunner* runner, |
| 329 ResolveFileTokenCallback resolve_file_token_cb) |
329 : lock_(), | 330 : lock_(), |
330 cond_var_(&lock_), | 331 cond_var_(&lock_), |
331 task_runner_(runner), | 332 task_runner_(runner), |
| 333 resolve_file_token_cb_(resolve_file_token_cb), |
332 locked_data_() { | 334 locked_data_() { |
333 io_thread_data_.channel_ = IPC::Channel::CreateServer(handle, this); | 335 io_thread_data_.channel_ = IPC::Channel::CreateServer(handle, this); |
334 // Note, we can not PostTask for ConnectChannelOnIOThread here. If we did, | 336 // Note, we can not PostTask for ConnectChannelOnIOThread here. If we did, |
335 // and that task ran before this constructor completes, the reference count | 337 // and that task ran before this constructor completes, the reference count |
336 // would go to 1 and then to 0 because of the Task, before we've been returned | 338 // would go to 1 and then to 0 because of the Task, before we've been returned |
337 // to the owning scoped_refptr, which is supposed to give us our first | 339 // to the owning scoped_refptr, which is supposed to give us our first |
338 // ref-count. | 340 // ref-count. |
339 } | 341 } |
340 | 342 |
341 NaClIPCAdapter::NaClIPCAdapter(scoped_ptr<IPC::Channel> channel, | 343 NaClIPCAdapter::NaClIPCAdapter(scoped_ptr<IPC::Channel> channel, |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 header.flags = msg.flags(); | 809 header.flags = msg.flags(); |
808 header.num_fds = static_cast<uint16>(rewritten_msg->desc_count()); | 810 header.num_fds = static_cast<uint16>(rewritten_msg->desc_count()); |
809 | 811 |
810 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); | 812 rewritten_msg->SetData(header, msg.payload(), msg.payload_size()); |
811 locked_data_.to_be_received_.push(rewritten_msg); | 813 locked_data_.to_be_received_.push(rewritten_msg); |
812 } | 814 } |
813 | 815 |
814 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { | 816 int TranslatePepperFileReadWriteOpenFlagsForTesting(int32_t pp_open_flags) { |
815 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); | 817 return TranslatePepperFileReadWriteOpenFlags(pp_open_flags); |
816 } | 818 } |
OLD | NEW |