diff --git a/network/module/nsNetStream.cpp b/network/module/nsNetStream.cpp index c34ad4de3321..b6775a020e19 100644 --- a/network/module/nsNetStream.cpp +++ b/network/module/nsNetStream.cpp @@ -44,6 +44,16 @@ nsConnectionInfo::nsConnectionInfo(nsIURL *aURL, { NS_INIT_REFCNT(); + /* + * Cache the thread which is making the network request. Any cross-thread + * marshalling events will be sent to its event queue... + * + * XXX: Currently, this assumes that the nsConnectionInfo is *always* + * created on the requesting thread... The requesting thread + * should really be passed in via the public APIs... + */ + mRequestingThread = PR_GetCurrentThread(); + mStatus = nsConnectionActive; pURL = aURL; pNetStream = aStream; diff --git a/network/module/nsNetStream.h b/network/module/nsNetStream.h index 91faf4df1e20..b4da2eda3f03 100644 --- a/network/module/nsNetStream.h +++ b/network/module/nsNetStream.h @@ -61,6 +61,7 @@ public: nsNetlibStream *pNetStream; nsIStreamListener *pConsumer; nsConnectionStatus mStatus; + PRThread* mRequestingThread; };