mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1160013 CachePushStreamChild should hold the parent DOM object alive. r=baku
This commit is contained in:
parent
86a6b07e7c
commit
f529480953
2
dom/cache/Cache.cpp
vendored
2
dom/cache/Cache.cpp
vendored
@ -512,7 +512,7 @@ Cache::CreatePushStream(nsIAsyncInputStream* aStream)
|
||||
NS_ASSERT_OWNINGTHREAD(Cache);
|
||||
MOZ_ASSERT(mActor);
|
||||
MOZ_ASSERT(aStream);
|
||||
return mActor->CreatePushStream(aStream);
|
||||
return mActor->CreatePushStream(this, aStream);
|
||||
}
|
||||
|
||||
Cache::~Cache()
|
||||
|
4
dom/cache/CacheChild.cpp
vendored
4
dom/cache/CacheChild.cpp
vendored
@ -73,11 +73,11 @@ CacheChild::ExecuteOp(nsIGlobalObject* aGlobal, Promise* aPromise,
|
||||
}
|
||||
|
||||
CachePushStreamChild*
|
||||
CacheChild::CreatePushStream(nsIAsyncInputStream* aStream)
|
||||
CacheChild::CreatePushStream(nsISupports* aParent, nsIAsyncInputStream* aStream)
|
||||
{
|
||||
mNumChildActors += 1;
|
||||
auto actor = SendPCachePushStreamConstructor(
|
||||
new CachePushStreamChild(GetFeature(), aStream));
|
||||
new CachePushStreamChild(GetFeature(), aParent, aStream));
|
||||
MOZ_ASSERT(actor);
|
||||
return static_cast<CachePushStreamChild*>(actor);
|
||||
}
|
||||
|
2
dom/cache/CacheChild.h
vendored
2
dom/cache/CacheChild.h
vendored
@ -43,7 +43,7 @@ public:
|
||||
nsISupports* aParent, const CacheOpArgs& aArgs);
|
||||
|
||||
CachePushStreamChild*
|
||||
CreatePushStream(nsIAsyncInputStream* aStream);
|
||||
CreatePushStream(nsISupports* aParent, nsIAsyncInputStream* aStream);
|
||||
|
||||
// Our parent Listener object has gone out of scope and is being destroyed.
|
||||
void StartDestroyFromListener();
|
||||
|
5
dom/cache/CachePushStreamChild.cpp
vendored
5
dom/cache/CachePushStreamChild.cpp
vendored
@ -93,10 +93,13 @@ NS_IMPL_ISUPPORTS(CachePushStreamChild::Callback, nsIInputStreamCallback,
|
||||
nsICancelableRunnable);
|
||||
|
||||
CachePushStreamChild::CachePushStreamChild(Feature* aFeature,
|
||||
nsISupports* aParent,
|
||||
nsIAsyncInputStream* aStream)
|
||||
: mStream(aStream)
|
||||
: mParent(aParent)
|
||||
, mStream(aStream)
|
||||
, mClosed(false)
|
||||
{
|
||||
MOZ_ASSERT(mParent);
|
||||
MOZ_ASSERT(mStream);
|
||||
MOZ_ASSERT_IF(!NS_IsMainThread(), aFeature);
|
||||
SetFeature(aFeature);
|
||||
|
4
dom/cache/CachePushStreamChild.h
vendored
4
dom/cache/CachePushStreamChild.h
vendored
@ -31,7 +31,8 @@ private:
|
||||
class Callback;
|
||||
|
||||
// This class must be constructed using CacheChild::CreatePushStream()
|
||||
CachePushStreamChild(Feature* aFeature, nsIAsyncInputStream* aStream);
|
||||
CachePushStreamChild(Feature* aFeature, nsISupports* aParent,
|
||||
nsIAsyncInputStream* aStream);
|
||||
~CachePushStreamChild();
|
||||
|
||||
// PCachePushStreamChild methods
|
||||
@ -46,6 +47,7 @@ private:
|
||||
|
||||
void OnEnd(nsresult aRv);
|
||||
|
||||
nsCOMPtr<nsISupports> mParent;
|
||||
nsCOMPtr<nsIAsyncInputStream> mStream;
|
||||
nsRefPtr<Callback> mCallback;
|
||||
bool mClosed;
|
||||
|
Loading…
Reference in New Issue
Block a user