Bug 804436 - Patch 1: Add listening status to UnixSocket. r=gyeh, a=blocking-basecamp
authorGina Yeh <gyeh@mozilla.com>
Fri, 26 Oct 2012 17:28:34 +0800
changeset 113739 5c200eb5ddf7adbf952aa47ad2eca8bf0fe79658
parent 113738 f4b928a9abfa6c6a0ee714a4558cc5746e4ad911
child 113740 b471cb0a563827f309e1a6702c6ab3eaa09dbea8
push id2483
push userryanvm@gmail.com
push dateSun, 28 Oct 2012 01:55:17 +0000
treeherdermozilla-aurora@029f67cb42b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgyeh, blocking-basecamp
bugs804436
milestone18.0a2
Bug 804436 - Patch 1: Add listening status to UnixSocket. r=gyeh, a=blocking-basecamp
ipc/unixsocket/UnixSocket.cpp
ipc/unixsocket/UnixSocket.h
--- a/ipc/unixsocket/UnixSocket.cpp
+++ b/ipc/unixsocket/UnixSocket.cpp
@@ -773,17 +773,17 @@ UnixSocketConsumer::ListenSocket(UnixSoc
   if (mImpl) {
     NS_WARNING("Socket already connecting/connected!");
     return false;
   }
   nsCString addr;
   mImpl = new UnixSocketImpl(this, aConnector, addr);
   XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
                                    new SocketAcceptTask(mImpl));
-  mConnectionStatus = SOCKET_CONNECTING;
+  mConnectionStatus = SOCKET_LISTENING;
   return true;
 }
 
 void
 UnixSocketConsumer::CancelSocketTask()
 {
   mConnectionStatus = SOCKET_DISCONNECTED;
   if(!mImpl) {
--- a/ipc/unixsocket/UnixSocket.h
+++ b/ipc/unixsocket/UnixSocket.h
@@ -111,18 +111,19 @@ public:
    */
   virtual void GetSocketAddr(const sockaddr& aAddr,
                              nsAString& aAddrStr) = 0;
 
 };
 
 enum SocketConnectionStatus {
   SOCKET_DISCONNECTED = 0,
-  SOCKET_CONNECTING = 1,
-  SOCKET_CONNECTED = 2
+  SOCKET_LISTENING = 1,
+  SOCKET_CONNECTING = 2,
+  SOCKET_CONNECTED = 3
 };
 
 class UnixSocketConsumer : public RefCounted<UnixSocketConsumer>
 {
 public:
   UnixSocketConsumer();
 
   virtual ~UnixSocketConsumer();