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::CreateClient( |
26 handle, IPC::Channel::MODE_CLIENT, this, | 26 handle, this, |
27 content::RenderThread::Get()->GetIOMessageLoopProxy(), | 27 content::RenderThread::Get()->GetIOMessageLoopProxy(), |
28 true, waitable_event)), | 28 true, waitable_event)), |
29 weak_ptr_factory_(this) { | 29 weak_ptr_factory_(this) { |
30 } | 30 } |
31 | 31 |
32 ManifestServiceChannel::~ManifestServiceChannel() { | 32 ManifestServiceChannel::~ManifestServiceChannel() { |
33 if (!connected_callback_.is_null()) | 33 if (!connected_callback_.is_null()) |
34 base::ResetAndReturn(&connected_callback_).Run(PP_ERROR_FAILED); | 34 base::ResetAndReturn(&connected_callback_).Run(PP_ERROR_FAILED); |
35 } | 35 } |
36 | 36 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 PpapiHostMsg_OpenResource::WriteReplyParams( | 87 PpapiHostMsg_OpenResource::WriteReplyParams( |
88 reply, | 88 reply, |
89 ppapi::proxy::SerializedHandle( | 89 ppapi::proxy::SerializedHandle( |
90 ppapi::proxy::SerializedHandle::FILE, | 90 ppapi::proxy::SerializedHandle::FILE, |
91 base::FileDescriptor(platform_file, true))); | 91 base::FileDescriptor(platform_file, true))); |
92 Send(reply); | 92 Send(reply); |
93 } | 93 } |
94 #endif | 94 #endif |
95 | 95 |
96 } // namespace nacl | 96 } // namespace nacl |
OLD | NEW |