зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1149987 - Part 6: Release the FetchPut object on the right thread in FetchObserver::OnResponseEnd(); r=bkelly
This commit is contained in:
Родитель
402e7e602a
Коммит
f56fe99956
|
@ -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:
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
private:
|
||||
class Runnable;
|
||||
class FetchObserver;
|
||||
friend class FetchObserver;
|
||||
struct State
|
||||
{
|
||||
PCacheRequest mPCacheRequest;
|
||||
|
|
Загрузка…
Ссылка в новой задаче