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

Side by Side Diff: ipc/ipc_channel_win.cc

Issue 5749001: Add support for sockets that can listen and accept a connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up use of DCHECK which was causing release build failures Created 10 years 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 | « ipc/ipc_channel_posix_unittest.cc ('k') | ipc/ipc_message_unittest.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "ipc/ipc_channel_win.h" 5 #include "ipc/ipc_channel_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <sddl.h> 8 #include <sddl.h>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 Channel::ChannelImpl::ChannelImpl(const IPC::ChannelHandle &channel_handle, 100 Channel::ChannelImpl::ChannelImpl(const IPC::ChannelHandle &channel_handle,
101 Mode mode, Listener* listener) 101 Mode mode, Listener* listener)
102 : ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)), 102 : ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)),
103 ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)), 103 ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)),
104 pipe_(INVALID_HANDLE_VALUE), 104 pipe_(INVALID_HANDLE_VALUE),
105 listener_(listener), 105 listener_(listener),
106 waiting_connect_(mode == MODE_SERVER), 106 waiting_connect_(mode == MODE_SERVER),
107 processing_incoming_(false), 107 processing_incoming_(false),
108 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { 108 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {
109 switch(mode) {
110 case MODE_NONE:
111 LOG(FATAL) << "Bad mode for " << channel_handle.name;
112 break;
113 case MODE_SERVER:
114 case MODE_CLIENT:
115 break;
116 case MODE_NAMED_SERVER:
117 mode = MODE_SERVER;
118 break;
119 case MODE_NAMED_CLIENT:
120 mode = MODE_CLIENT;
121 break;
122 // Intentionally no default case here so that the compiler
123 // will check that we handle all the cases in the enum.
124 }
109 if (!CreatePipe(channel_handle, mode)) { 125 if (!CreatePipe(channel_handle, mode)) {
110 // The pipe may have been closed already. 126 // The pipe may have been closed already.
111 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name << 127 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name <<
112 "\" in " << (mode == 0 ? "server" : "client") << " mode."; 128 "\" in " << (mode == 0 ? "server" : "client") << " mode.";
113 } 129 }
114 } 130 }
115 131
116 Channel::ChannelImpl::~ChannelImpl() { 132 Channel::ChannelImpl::~ChannelImpl() {
117 Close(); 133 Close();
118 } 134 }
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 504
489 void Channel::set_listener(Listener* listener) { 505 void Channel::set_listener(Listener* listener) {
490 channel_impl_->set_listener(listener); 506 channel_impl_->set_listener(listener);
491 } 507 }
492 508
493 bool Channel::Send(Message* message) { 509 bool Channel::Send(Message* message) {
494 return channel_impl_->Send(message); 510 return channel_impl_->Send(message);
495 } 511 }
496 512
497 } // namespace IPC 513 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix_unittest.cc ('k') | ipc/ipc_message_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698