зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1723946 - Avoid racing on sSocketProcessChild, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D129502
This commit is contained in:
Родитель
262d2490e3
Коммит
6d485bbb43
|
@ -12,6 +12,7 @@
|
|||
#include "HttpTransactionChild.h"
|
||||
#include "HttpConnectionMgrChild.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Components.h"
|
||||
#include "mozilla/dom/MemoryReportRequest.h"
|
||||
#include "mozilla/ipc/CrashReporterClient.h"
|
||||
|
@ -75,7 +76,7 @@ using namespace ipc;
|
|||
|
||||
static bool sInitializedJS = false;
|
||||
|
||||
SocketProcessChild* sSocketProcessChild;
|
||||
static Atomic<SocketProcessChild*> sSocketProcessChild;
|
||||
|
||||
SocketProcessChild::SocketProcessChild() {
|
||||
LOG(("CONSTRUCT SocketProcessChild::SocketProcessChild\n"));
|
||||
|
|
|
@ -11,11 +11,15 @@ namespace net {
|
|||
|
||||
BackgroundDataBridgeParent::BackgroundDataBridgeParent(uint64_t aChannelID)
|
||||
: mChannelID(aChannelID), mBackgroundThread(NS_GetCurrentThread()) {
|
||||
SocketProcessChild::GetSingleton()->AddDataBridgeToMap(aChannelID, this);
|
||||
if (SocketProcessChild* child = SocketProcessChild::GetSingleton()) {
|
||||
child->AddDataBridgeToMap(aChannelID, this);
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundDataBridgeParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
SocketProcessChild::GetSingleton()->RemoveDataBridgeFromMap(mChannelID);
|
||||
if (SocketProcessChild* child = SocketProcessChild::GetSingleton()) {
|
||||
child->RemoveDataBridgeFromMap(mChannelID);
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<nsIThread> BackgroundDataBridgeParent::GetBackgroundThread() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче