mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1149987 - Part 6: Release the FetchPut object on the right thread in FetchObserver::OnResponseEnd(); r=bkelly
This commit is contained in:
parent
402e7e602a
commit
f56fe99956
10
dom/cache/FetchPut.cpp
vendored
10
dom/cache/FetchPut.cpp
vendored
@ -77,7 +77,15 @@ public:
|
||||
virtual void OnResponseEnd() override
|
||||
{
|
||||
mFetchPut->FetchComplete(this, mInternalResponse);
|
||||
mFetchPut = nullptr;
|
||||
if (mFetchPut->mInitiatingThread == NS_GetCurrentThread()) {
|
||||
mFetchPut = nullptr;
|
||||
} else {
|
||||
nsCOMPtr<nsIThread> initiatingThread(mFetchPut->mInitiatingThread);
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewNonOwningRunnableMethod(mFetchPut.forget().take(), &FetchPut::Release);
|
||||
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
|
||||
initiatingThread->Dispatch(runnable, nsIThread::DISPATCH_NORMAL)));
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
|
1
dom/cache/FetchPut.h
vendored
1
dom/cache/FetchPut.h
vendored
@ -54,6 +54,7 @@ public:
|
||||
private:
|
||||
class Runnable;
|
||||
class FetchObserver;
|
||||
friend class FetchObserver;
|
||||
struct State
|
||||
{
|
||||
PCacheRequest mPCacheRequest;
|
||||
|
Loading…
Reference in New Issue
Block a user