Bug 1011110: Don't allow replying to a BluetoothRequest twice. r=bent
authorKyle Huey <khuey@kylehuey.com>
Mon, 02 Jun 2014 19:02:27 -0700
changeset 205448 1cd1d27985e99f9c2ddd79907c29745f1be6e584
parent 205447 143ce643d1b3c7908a91065e551793573aa4d4f3
child 205449 d69a0de220ae8dacfd502df6c5c393570e86ce16
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1011110
milestone32.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 1011110: Don't allow replying to a BluetoothRequest twice. r=bent
dom/bluetooth/ipc/BluetoothParent.cpp
--- a/dom/bluetooth/ipc/BluetoothParent.cpp
+++ b/dom/bluetooth/ipc/BluetoothParent.cpp
@@ -19,17 +19,17 @@
 
 using mozilla::unused;
 USING_BLUETOOTH_NAMESPACE
 
 /*******************************************************************************
  * BluetoothRequestParent::ReplyRunnable
  ******************************************************************************/
 
-class BluetoothRequestParent::ReplyRunnable : public BluetoothReplyRunnable
+class BluetoothRequestParent::ReplyRunnable MOZ_FINAL : public BluetoothReplyRunnable
 {
   BluetoothRequestParent* mRequest;
 
 public:
   ReplyRunnable(BluetoothRequestParent* aRequest)
   : BluetoothReplyRunnable(nullptr), mRequest(aRequest)
   {
     MOZ_ASSERT(NS_IsMainThread());
@@ -54,25 +54,32 @@ public:
 
     ReleaseMembers();
     return NS_OK;
   }
 
   void
   Revoke()
   {
-    MOZ_ASSERT(NS_IsMainThread());
-    mRequest = nullptr;
+    ReleaseMembers();
   }
 
   virtual bool
   ParseSuccessfulReply(JS::MutableHandle<JS::Value> aValue) MOZ_OVERRIDE
   {
     MOZ_CRASH("This should never be called!");
   }
+
+  virtual void
+  ReleaseMembers() MOZ_OVERRIDE
+  {
+    MOZ_ASSERT(NS_IsMainThread());
+    mRequest = nullptr;
+    BluetoothReplyRunnable::ReleaseMembers();
+  }
 };
 
 /*******************************************************************************
  * BluetoothParent
  ******************************************************************************/
 
 BluetoothParent::BluetoothParent()
 : mShutdownState(Running)