Skip to content

Commit

Permalink
Bug 1263991 part 7: Add assertions checking that the actor is still a…
Browse files Browse the repository at this point in the history
…live on incoming messages. r=baku
  • Loading branch information
sicking committed Jun 7, 2016
1 parent add35a6 commit cca65fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dom/flyweb/FlyWebPublishedServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ bool
FlyWebPublishedServerChild::RecvServerReady(const nsresult& aStatus)
{
LOG_I("FlyWebPublishedServerChild::RecvServerReady(%p)", this);
MOZ_ASSERT(!mActorDestroyed);

PublishedServerStarted(aStatus);
return true;
Expand All @@ -279,6 +280,7 @@ bool
FlyWebPublishedServerChild::RecvServerClose()
{
LOG_I("FlyWebPublishedServerChild::RecvServerClose(%p)", this);
MOZ_ASSERT(!mActorDestroyed);

Close();

Expand All @@ -290,6 +292,7 @@ FlyWebPublishedServerChild::RecvFetchRequest(const IPCInternalRequest& aRequest,
const uint64_t& aRequestId)
{
LOG_I("FlyWebPublishedServerChild::RecvFetchRequest(%p)", this);
MOZ_ASSERT(!mActorDestroyed);

RefPtr<InternalRequest> request = new InternalRequest(aRequest);
mPendingRequests.Put(request, aRequestId);
Expand All @@ -304,6 +307,7 @@ FlyWebPublishedServerChild::RecvWebSocketRequest(const IPCInternalRequest& aRequ
PTransportProviderChild* aProvider)
{
LOG_I("FlyWebPublishedServerChild::RecvWebSocketRequest(%p)", this);
MOZ_ASSERT(!mActorDestroyed);

RefPtr<InternalRequest> request = new InternalRequest(aRequest);
mPendingRequests.Put(request, aRequestId);
Expand Down Expand Up @@ -536,6 +540,8 @@ bool
FlyWebPublishedServerParent::RecvFetchResponse(const IPCInternalResponse& aResponse,
const uint64_t& aRequestId)
{
MOZ_ASSERT(!mActorDestroyed);

RefPtr<InternalRequest> request;
mPendingRequests.Remove(aRequestId, getter_AddRefs(request));
if (!request) {
Expand All @@ -554,6 +560,8 @@ bool
FlyWebPublishedServerParent::RecvWebSocketResponse(const IPCInternalResponse& aResponse,
const uint64_t& aRequestId)
{
MOZ_ASSERT(!mActorDestroyed);

mPendingTransportProviders.Remove(aRequestId);

RefPtr<InternalRequest> request;
Expand All @@ -574,6 +582,8 @@ bool
FlyWebPublishedServerParent::RecvWebSocketAccept(const nsString& aProtocol,
const uint64_t& aRequestId)
{
MOZ_ASSERT(!mActorDestroyed);

RefPtr<TransportProviderParent> providerIPC;
mPendingTransportProviders.Remove(aRequestId, getter_AddRefs(providerIPC));

Expand Down Expand Up @@ -614,6 +624,7 @@ bool
FlyWebPublishedServerParent::Recv__delete__()
{
LOG_I("FlyWebPublishedServerParent::Recv__delete__(%p)", this);
MOZ_ASSERT(!mActorDestroyed);

if (mPublishedServer) {
mPublishedServer->RemoveEventListener(NS_LITERAL_STRING("fetch"),
Expand Down

0 comments on commit cca65fb

Please sign in to comment.