Bug 846615 - Remove some functionality that is no longer needed, r=bent
authorBlake Kaplan <mrbkap@gmail.com>
Fri, 08 Mar 2013 15:03:03 +0800
changeset 135420 88517161a93dbb10bd6b4eab4a152efc59af0078
parent 135419 d5ed7f560d5f4ee74f98a961a82bd924714b6a5c
child 135421 b20599257ae765088e8e0e3a271e4332bec718c7
push id336
push userakeybl@mozilla.com
push dateMon, 17 Jun 2013 22:53:19 +0000
treeherdermozilla-release@574a39cdf657 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs846615
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 846615 - Remove some functionality that is no longer needed, r=bent
ipc/unixsocket/UnixSocket.cpp
--- a/ipc/unixsocket/UnixSocket.cpp
+++ b/ipc/unixsocket/UnixSocket.cpp
@@ -44,17 +44,16 @@ class UnixSocketImpl : public MessageLoo
 {
 public:
   UnixSocketImpl(UnixSocketConsumer* aConsumer, UnixSocketConnector* aConnector,
                  const nsACString& aAddress)
     : mConsumer(aConsumer)
     , mIOLoop(nullptr)
     , mConnector(aConnector)
     , mShuttingDownOnIOThread(false)
-    , mTask(nullptr)
     , mAddress(aAddress)
   {
   }
 
   ~UnixSocketImpl()
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_ASSERT(IsShutdownOnMainThread());
@@ -93,47 +92,16 @@ public:
   {
     MOZ_ASSERT(!NS_IsMainThread());
     MOZ_ASSERT(!mShuttingDownOnIOThread);
 
     mReadWatcher.StopWatchingFileDescriptor();
     mWriteWatcher.StopWatchingFileDescriptor();
 
     mShuttingDownOnIOThread = true;
-    if (mTask) {
-      mTask->Cancel();
-      mTask = nullptr;
-    }
-  }
-
-  // NB: Any CancelableTask that is passed into EnqueueTask *must* set mTask to
-  // nullptr in its run method if it was not already canceled.
-  void EnqueueTask(int aDelayMs, CancelableTask* aTask)
-  {
-    MOZ_ASSERT(!NS_IsMainThread());
-
-    nsAutoPtr<CancelableTask> task(aTask);
-    MessageLoopForIO* ioLoop = MessageLoopForIO::current();
-    if (!ioLoop) {
-      NS_WARNING("No IOLoop to attach to, cancelling self!");
-      return;
-    }
-    if (mTask) {
-      return;
-    }
-    if (mShuttingDownOnIOThread) {
-      return;
-    }
-
-    mTask = task.forget();
-    if (aDelayMs) {
-      ioLoop->PostDelayedTask(FROM_HERE, mTask, aDelayMs);
-    } else {
-      ioLoop->PostTask(FROM_HERE, mTask);
-    }
   }
 
   void SetUpIO()
   {
     MOZ_ASSERT(!mIOLoop);
     MOZ_ASSERT(mFd >= 0);
     mIOLoop = MessageLoopForIO::current();
     mIOLoop->WatchFileDescriptor(mFd,
@@ -233,22 +201,16 @@ private:
   nsAutoPtr<UnixSocketConnector> mConnector;
 
   /**
    * If true, do not requeue whatever task we're running
    */
   bool mShuttingDownOnIOThread;
 
   /**
-   * Pointer to the task we're currently running. DO NOT DELETE MANUALLY. This
-   * will be taken care of by the IO loop. Just set to nullptr.
-   */
-  CancelableTask* mTask;
-
-  /**
    * Address we are connecting to, assuming we are creating a client connection.
    */
   nsCString mAddress;
 
   /**
    * Size of the socket address struct
    */
   socklen_t mAddrSize;
@@ -466,17 +428,16 @@ void ShutdownSocketTask::Run()
   nsresult rv = NS_DispatchToMainThread(t);
   NS_ENSURE_SUCCESS_VOID(rv);
 }
 
 void  
 UnixSocketImpl::Accept()
 {
   MOZ_ASSERT(!NS_IsMainThread());
-  mTask = nullptr;
 
   if (!mConnector) {
     NS_WARNING("No connector object available!");
     return;
   }
 
   // This will set things we don't particularly care about, but it will hand
   // back the correct structure size which is what we do care about.