Bug 1011110: Don't allow replying to a BluetoothRequest twice. r=bent

This commit is contained in:
Kyle Huey 2014-06-02 19:02:27 -07:00
parent b0e7055ef0
commit 3fdfb7f0db

View File

@ -24,7 +24,7 @@ USING_BLUETOOTH_NAMESPACE
* BluetoothRequestParent::ReplyRunnable
******************************************************************************/
class BluetoothRequestParent::ReplyRunnable : public BluetoothReplyRunnable
class BluetoothRequestParent::ReplyRunnable MOZ_FINAL : public BluetoothReplyRunnable
{
BluetoothRequestParent* mRequest;
@ -59,8 +59,7 @@ public:
void
Revoke()
{
MOZ_ASSERT(NS_IsMainThread());
mRequest = nullptr;
ReleaseMembers();
}
virtual bool
@ -68,6 +67,14 @@ public:
{
MOZ_CRASH("This should never be called!");
}
virtual void
ReleaseMembers() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
mRequest = nullptr;
BluetoothReplyRunnable::ReleaseMembers();
}
};
/*******************************************************************************