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

Side by Side Diff: remoting/host/ipc_util_win.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
« no previous file with comments | « remoting/host/ipc_util_posix.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "remoting/host/ipc_util.h" 5 #include "remoting/host/ipc_util.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Generate a unique name for the channel. 45 // Generate a unique name for the channel.
46 std::string channel_name = IPC::Channel::GenerateUniqueRandomChannelID(); 46 std::string channel_name = IPC::Channel::GenerateUniqueRandomChannelID();
47 47
48 // Create the server end of the channel. 48 // Create the server end of the channel.
49 ScopedHandle pipe; 49 ScopedHandle pipe;
50 if (!CreateIpcChannel(channel_name, security_descriptor, &pipe)) { 50 if (!CreateIpcChannel(channel_name, security_descriptor, &pipe)) {
51 return false; 51 return false;
52 } 52 }
53 53
54 // Wrap the pipe into an IPC channel. 54 // Wrap the pipe into an IPC channel.
55 scoped_ptr<IPC::ChannelProxy> server(new IPC::ChannelProxy( 55 scoped_ptr<IPC::ChannelProxy> server =
56 IPC::ChannelHandle(pipe), 56 IPC::ChannelProxy::Create(IPC::ChannelHandle(pipe),
57 IPC::Channel::MODE_SERVER, 57 IPC::Channel::MODE_SERVER,
58 listener, 58 listener,
59 io_task_runner)); 59 io_task_runner);
60 60
61 // Convert the channel name to the pipe name. 61 // Convert the channel name to the pipe name.
62 std::string pipe_name(kChromePipeNamePrefix); 62 std::string pipe_name(kChromePipeNamePrefix);
63 pipe_name.append(channel_name); 63 pipe_name.append(channel_name);
64 64
65 SECURITY_ATTRIBUTES security_attributes = {0}; 65 SECURITY_ATTRIBUTES security_attributes = {0};
66 security_attributes.nLength = sizeof(security_attributes); 66 security_attributes.nLength = sizeof(security_attributes);
67 security_attributes.lpSecurityDescriptor = NULL; 67 security_attributes.lpSecurityDescriptor = NULL;
68 security_attributes.bInheritHandle = TRUE; 68 security_attributes.bInheritHandle = TRUE;
69 69
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 PLOG(ERROR) 124 PLOG(ERROR)
125 << "Failed to create the server end of the Chromoting IPC channel"; 125 << "Failed to create the server end of the Chromoting IPC channel";
126 return false; 126 return false;
127 } 127 }
128 128
129 *pipe_out = pipe.Pass(); 129 *pipe_out = pipe.Pass();
130 return true; 130 return true;
131 } 131 }
132 132
133 } // namespace remoting 133 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/ipc_util_posix.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698