mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 813489 - Update the HTTP connection's security callbacks from the socket thread. r=mayhemer
This commit is contained in:
parent
42b1460c64
commit
6f203f7db0
@ -27,6 +27,7 @@
|
||||
#include "nsComponentManagerUtils.h" // do_CreateInstance
|
||||
#include "nsServiceManagerUtils.h" // do_GetService
|
||||
#include "nsIHttpActivityObserver.h"
|
||||
#include "nsSocketTransportService2.h"
|
||||
|
||||
|
||||
using namespace mozilla;
|
||||
@ -407,8 +408,10 @@ nsHttpTransaction::SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks)
|
||||
MutexAutoLock lock(mCallbacksLock);
|
||||
mCallbacks = aCallbacks;
|
||||
}
|
||||
if (mConnection) {
|
||||
mConnection->SetSecurityCallbacks(aCallbacks);
|
||||
|
||||
if (gSocketTransportService) {
|
||||
nsRefPtr<UpdateSecurityCallbacks> event = new UpdateSecurityCallbacks(this, aCallbacks);
|
||||
gSocketTransportService->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ class nsHttpRequestHead;
|
||||
class nsHttpResponseHead;
|
||||
class nsHttpChunkedDecoder;
|
||||
class nsIHttpActivityObserver;
|
||||
class UpdateSecurityCallbacks;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsHttpTransaction represents a single HTTP transaction. It is thread-safe,
|
||||
@ -142,6 +143,24 @@ private:
|
||||
bool TimingEnabled() const { return mCaps & NS_HTTP_TIMING_ENABLED; }
|
||||
|
||||
private:
|
||||
class UpdateSecurityCallbacks : public nsRunnable
|
||||
{
|
||||
public:
|
||||
UpdateSecurityCallbacks(nsHttpTransaction* aTrans,
|
||||
nsIInterfaceRequestor* aCallbacks)
|
||||
: mTrans(aTrans), mCallbacks(aCallbacks) {}
|
||||
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
if (mTrans->mConnection)
|
||||
mTrans->mConnection->SetSecurityCallbacks(mCallbacks);
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
nsRefPtr<nsHttpTransaction> mTrans;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
};
|
||||
|
||||
mozilla::Mutex mCallbacksLock;
|
||||
|
||||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
|
Loading…
Reference in New Issue
Block a user