icecat: add release icecat-140.10.1-1gnu1 for ecne
This commit is contained in:
parent
a5f93cb214
commit
ff85d7c623
1256 changed files with 63469 additions and 24141 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "mozilla/ModuleUtils.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Omnijar.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
#include "MozSrcProtocolHandler.h"
|
||||
|
||||
|
|
@ -19,16 +20,31 @@ NS_IMPL_QUERY_INTERFACE(MozSrcProtocolHandler, nsISubstitutingProtocolHandler,
|
|||
NS_IMPL_ADDREF_INHERITED(MozSrcProtocolHandler, SubstitutingProtocolHandler)
|
||||
NS_IMPL_RELEASE_INHERITED(MozSrcProtocolHandler, SubstitutingProtocolHandler)
|
||||
|
||||
mozilla::StaticMutex MozSrcProtocolHandler::sMutex;
|
||||
mozilla::StaticRefPtr<MozSrcProtocolHandler> MozSrcProtocolHandler::sSingleton;
|
||||
|
||||
already_AddRefed<MozSrcProtocolHandler> MozSrcProtocolHandler::GetSingleton() {
|
||||
StaticMutexAutoLock lock(sMutex);
|
||||
if (!sSingleton) {
|
||||
RefPtr<MozSrcProtocolHandler> handler = new MozSrcProtocolHandler();
|
||||
if (NS_WARN_IF(NS_FAILED(handler->Init()))) {
|
||||
return nullptr;
|
||||
}
|
||||
sSingleton = handler;
|
||||
ClearOnShutdown(&sSingleton);
|
||||
auto prevent_shutdown_race = [] {
|
||||
StaticMutexAutoLock lock(sMutex);
|
||||
sSingleton = nullptr;
|
||||
};
|
||||
if (NS_IsMainThread()) {
|
||||
RunOnShutdown(std::move(prevent_shutdown_race));
|
||||
} else {
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction(
|
||||
"MozSrcProtocolHandler::RunOnShutdown",
|
||||
[prevent_shutdown_race =
|
||||
std::move(prevent_shutdown_race)]() mutable {
|
||||
RunOnShutdown(std::move(prevent_shutdown_race));
|
||||
}));
|
||||
}
|
||||
}
|
||||
return do_AddRef(sSingleton);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue