diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-20 06:59:23 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-20 06:59:23 +0000 |
commit | 22b42c595b55ca0c589658d9ab6d073da728833a (patch) | |
tree | b8dd72a433eb6f75a80c900a6367c24b0dc73bbd /ipc/ipc_channel_win.cc | |
parent | c7f91e87683077af61f33432d179bf22e17744da (diff) | |
download | chromium_src-22b42c595b55ca0c589658d9ab6d073da728833a.zip chromium_src-22b42c595b55ca0c589658d9ab6d073da728833a.tar.gz chromium_src-22b42c595b55ca0c589658d9ab6d073da728833a.tar.bz2 |
Add support for sockets that can listen and accept a connection.
These sockets allow one connection at a time, however clients can
connect and disconnect repeatedly.
These are going to be used by Cloud Print, Remoting and
Automation.
BUG=NONE
TEST=BUILD
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69660
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69690
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69694
Review URL: http://codereview.chromium.org/5749001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_win.cc')
-rw-r--r-- | ipc/ipc_channel_win.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index e12c521..0e7ba1b 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -106,6 +106,22 @@ Channel::ChannelImpl::ChannelImpl(const IPC::ChannelHandle &channel_handle, waiting_connect_(mode == MODE_SERVER), processing_incoming_(false), ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { + switch(mode) { + case MODE_NONE: + LOG(FATAL) << "Bad mode for " << channel_handle.name; + break; + case MODE_SERVER: + case MODE_CLIENT: + break; + case MODE_NAMED_SERVER: + mode = MODE_SERVER; + break; + case MODE_NAMED_CLIENT: + mode = MODE_CLIENT; + break; + // Intentionally no default case here so that the compiler + // will check that we handle all the cases in the enum. + } if (!CreatePipe(channel_handle, mode)) { // The pipe may have been closed already. LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name << |