Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: components/nacl/renderer/manifest_service_channel.cc

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/nacl/loader/nacl_trusted_listener.cc ('k') | components/nacl/renderer/trusted_plugin_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698