OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/manifest_service_channel.h" | 5 #include "components/nacl/renderer/manifest_service_channel.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
11 #include "ipc/ipc_channel.h" | 11 #include "ipc/ipc_channel.h" |
12 #include "ipc/ipc_sync_channel.h" | 12 #include "ipc/ipc_sync_channel.h" |
13 #include "ppapi/c/pp_errors.h" | 13 #include "ppapi/c/pp_errors.h" |
14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
15 | 15 |
16 namespace nacl { | 16 namespace nacl { |
17 | 17 |
18 ManifestServiceChannel::ManifestServiceChannel( | 18 ManifestServiceChannel::ManifestServiceChannel( |
19 const IPC::ChannelHandle& handle, | 19 const IPC::ChannelHandle& handle, |
20 const base::Callback<void(int32_t)>& connected_callback, | 20 const base::Callback<void(int32_t)>& connected_callback, |
21 scoped_ptr<Delegate> delegate, | 21 scoped_ptr<Delegate> delegate, |
22 base::WaitableEvent* waitable_event) | 22 base::WaitableEvent* waitable_event) |
23 : connected_callback_(connected_callback), | 23 : connected_callback_(connected_callback), |
24 delegate_(delegate.Pass()), | 24 delegate_(delegate.Pass()), |
25 channel_(new IPC::SyncChannel( | 25 channel_(IPC::SyncChannel::Create( |
26 handle, IPC::Channel::MODE_CLIENT, this, | 26 handle, |
| 27 IPC::Channel::MODE_CLIENT, |
| 28 this, |
27 content::RenderThread::Get()->GetIOMessageLoopProxy(), | 29 content::RenderThread::Get()->GetIOMessageLoopProxy(), |
28 true, waitable_event)), | 30 true, |
| 31 waitable_event)), |
29 weak_ptr_factory_(this) { | 32 weak_ptr_factory_(this) { |
30 } | 33 } |
31 | 34 |
32 ManifestServiceChannel::~ManifestServiceChannel() { | 35 ManifestServiceChannel::~ManifestServiceChannel() { |
33 if (!connected_callback_.is_null()) | 36 if (!connected_callback_.is_null()) |
34 base::ResetAndReturn(&connected_callback_).Run(PP_ERROR_FAILED); | 37 base::ResetAndReturn(&connected_callback_).Run(PP_ERROR_FAILED); |
35 } | 38 } |
36 | 39 |
37 void ManifestServiceChannel::Send(IPC::Message* message) { | 40 void ManifestServiceChannel::Send(IPC::Message* message) { |
38 channel_->Send(message); | 41 channel_->Send(message); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 PpapiHostMsg_OpenResource::WriteReplyParams( | 90 PpapiHostMsg_OpenResource::WriteReplyParams( |
88 reply, | 91 reply, |
89 ppapi::proxy::SerializedHandle( | 92 ppapi::proxy::SerializedHandle( |
90 ppapi::proxy::SerializedHandle::FILE, | 93 ppapi::proxy::SerializedHandle::FILE, |
91 base::FileDescriptor(platform_file, true))); | 94 base::FileDescriptor(platform_file, true))); |
92 Send(reply); | 95 Send(reply); |
93 } | 96 } |
94 #endif | 97 #endif |
95 | 98 |
96 } // namespace nacl | 99 } // namespace nacl |
OLD | NEW |