mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 924967 - Add main thread assertions for Cancel in nsLoadGroup, nsHttpChannel and nsInputStreamPump r=mcmanus
This commit is contained in:
parent
5c3c252d31
commit
2201bcbcea
@ -198,6 +198,8 @@ nsInputStreamPump::GetStatus(nsresult *status)
|
||||
NS_IMETHODIMP
|
||||
nsInputStreamPump::Cancel(nsresult status)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
ReentrantMonitorAutoEnter mon(mMonitor);
|
||||
|
||||
LOG(("nsInputStreamPump::Cancel [this=%p status=%x]\n",
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIRequestObserver.h"
|
||||
#include "CacheObserver.h"
|
||||
#include "MainThreadUtils.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::net;
|
||||
@ -224,6 +225,8 @@ AppendRequestsToArray(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
NS_IMETHODIMP
|
||||
nsLoadGroup::Cancel(nsresult status)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ASSERTION(NS_FAILED(status), "shouldn't cancel with a success code");
|
||||
nsresult rv;
|
||||
uint32_t count = mRequests.entryCount;
|
||||
|
@ -917,6 +917,8 @@ HttpChannelChild::OnRedirectVerifyCallback(nsresult result)
|
||||
NS_IMETHODIMP
|
||||
HttpChannelChild::Cancel(nsresult status)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mCanceled) {
|
||||
// If this cancel occurs before nsHttpChannel has been set up, AsyncOpen
|
||||
// is responsible for cleaning up.
|
||||
|
@ -4308,6 +4308,8 @@ NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
|
||||
NS_IMETHODIMP
|
||||
nsHttpChannel::Cancel(nsresult status)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
LOG(("nsHttpChannel::Cancel [this=%p status=%x]\n", this, status));
|
||||
if (mCanceled) {
|
||||
LOG((" ignoring; already canceled\n"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user