Bug 1110485 P4 Keep Cache Actors alive during async operations. r=baku

This commit is contained in:
Ben Kelly
2015-04-16 12:00:15 -07:00
parent b143e5d19b
commit ccf34d901e
15 changed files with 194 additions and 32 deletions

11
dom/cache/Cache.cpp vendored
View File

@@ -14,7 +14,6 @@
#include "mozilla/dom/CacheBinding.h"
#include "mozilla/dom/cache/AutoUtils.h"
#include "mozilla/dom/cache/CacheChild.h"
#include "mozilla/dom/cache/CacheOpChild.h"
#include "mozilla/dom/cache/CachePushStreamChild.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/ErrorResult.h"
@@ -350,10 +349,7 @@ Cache::CreatePushStream(nsIAsyncInputStream* aStream)
NS_ASSERT_OWNINGTHREAD(Cache);
MOZ_ASSERT(mActor);
MOZ_ASSERT(aStream);
auto actor = mActor->SendPCachePushStreamConstructor(
new CachePushStreamChild(mActor->GetFeature(), aStream));
MOZ_ASSERT(actor);
return static_cast<CachePushStreamChild*>(actor);
return mActor->CreatePushStream(aStream);
}
Cache::~Cache()
@@ -375,10 +371,7 @@ Cache::ExecuteOp(AutoChildOpArgs& aOpArgs, ErrorResult& aRv)
return nullptr;
}
unused << mActor->SendPCacheOpConstructor(
new CacheOpChild(mActor->GetFeature(), mGlobal, this, promise),
aOpArgs.SendAsOpArgs());
mActor->ExecuteOp(mGlobal, promise, aOpArgs.SendAsOpArgs());
return promise.forget();
}