Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug.

Differential Revision: https://phabricator.services.mozilla.com/D124349
This commit is contained in:
Florian Quèze 2021-09-07 08:01:18 +00:00
Родитель 21bc5c0376
Коммит 998adb18ea
48 изменённых файлов: 281 добавлений и 42 удалений

Просмотреть файл

@ -29,8 +29,9 @@ NS_IMPL_ADDREF(MaybeCloseWindowHelper)
NS_IMPL_RELEASE(MaybeCloseWindowHelper)
NS_INTERFACE_MAP_BEGIN(MaybeCloseWindowHelper)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_END
MaybeCloseWindowHelper::MaybeCloseWindowHelper(BrowsingContext* aContentContext)
@ -100,6 +101,12 @@ MaybeCloseWindowHelper::Notify(nsITimer* timer) {
return NS_OK;
}
NS_IMETHODIMP
MaybeCloseWindowHelper::GetName(nsACString& aName) {
aName.AssignLiteral("MaybeCloseWindowHelper");
return NS_OK;
}
nsDSURIContentListener::nsDSURIContentListener(nsDocShell* aDocShell)
: mDocShell(aDocShell),
mExistingJPEGRequest(nullptr),

Просмотреть файл

@ -18,10 +18,11 @@ class nsIWebNavigationInfo;
class nsPIDOMWindowOuter;
// Helper Class to eventually close an already opened window
class MaybeCloseWindowHelper final : public nsITimerCallback {
class MaybeCloseWindowHelper final : public nsITimerCallback, public nsINamed {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
explicit MaybeCloseWindowHelper(
mozilla::dom::BrowsingContext* aContentContext);

Просмотреть файл

@ -77,6 +77,7 @@ class EventSourceImpl final : public nsIObserver,
public nsSupportsWeakReference,
public nsIEventTarget,
public nsITimerCallback,
public nsINamed,
public nsIThreadRetargetableStreamListener {
public:
NS_DECL_THREADSAFE_ISUPPORTS
@ -87,6 +88,7 @@ class EventSourceImpl final : public nsIObserver,
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSIEVENTTARGET_FULL
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
EventSourceImpl(EventSource* aEventSource,
@ -362,7 +364,7 @@ NS_IMPL_ISUPPORTS(EventSourceImpl, nsIObserver, nsIStreamListener,
nsIRequestObserver, nsIChannelEventSink,
nsIInterfaceRequestor, nsISupportsWeakReference,
nsIEventTarget, nsIThreadRetargetableStreamListener,
nsITimerCallback)
nsITimerCallback, nsINamed)
EventSourceImpl::EventSourceImpl(EventSource* aEventSource,
nsICookieJarSettings* aCookieJarSettings)
@ -1404,6 +1406,11 @@ NS_IMETHODIMP EventSourceImpl::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP EventSourceImpl::GetName(nsACString& aName) {
aName.AssignLiteral("EventSourceImpl");
return NS_OK;
}
nsresult EventSourceImpl::Thaw() {
AssertIsOnMainThread();
if (IsClosed() || !mFrozen) {

Просмотреть файл

@ -28,7 +28,7 @@ namespace mozilla::dom {
NS_IMPL_CYCLE_COLLECTION_INHERITED(MediaController, DOMEventTargetHelper)
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(MediaController,
DOMEventTargetHelper,
nsITimerCallback)
nsITimerCallback, nsINamed)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(MediaController,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
@ -310,6 +310,11 @@ NS_IMETHODIMP MediaController::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP MediaController::GetName(nsACString& aName) {
aName.AssignLiteral("MediaController");
return NS_OK;
}
void MediaController::NotifyMediaAudibleChanged(uint64_t aBrowsingContextId,
MediaAudibleState aState) {
if (mShutdown) {

Просмотреть файл

@ -75,10 +75,12 @@ class MediaController final : public DOMEventTargetHelper,
public IMediaController,
public LinkedListElement<RefPtr<MediaController>>,
public MediaStatusManager,
public nsITimerCallback {
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaController,
DOMEventTargetHelper)
explicit MediaController(uint64_t aBrowsingContextId);

Просмотреть файл

@ -23,6 +23,7 @@ NS_IMPL_RELEASE_INHERITED(RTCDTMFSender, DOMEventTargetHelper)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(RTCDTMFSender)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
LazyLogModule gDtmfLog("RTCDTMFSender");
@ -141,6 +142,11 @@ nsresult RTCDTMFSender::Notify(nsITimer* timer) {
return NS_OK;
}
nsresult RTCDTMFSender::GetName(nsACString& aName) {
aName.AssignLiteral("RTCDTMFSender");
return NS_OK;
}
void RTCDTMFSender::GetToneBuffer(nsAString& aOutToneBuffer) {
aOutToneBuffer = mToneBuffer;
}

Просмотреть файл

@ -19,7 +19,9 @@ class TransceiverImpl;
namespace dom {
class RTCDTMFSender : public DOMEventTargetHelper, public nsITimerCallback {
class RTCDTMFSender : public DOMEventTargetHelper,
public nsITimerCallback,
public nsINamed {
public:
explicit RTCDTMFSender(nsPIDOMWindowInner* aWindow,
TransceiverImpl* aTransceiver,
@ -27,6 +29,7 @@ class RTCDTMFSender : public DOMEventTargetHelper, public nsITimerCallback {
// nsISupports
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCDTMFSender, DOMEventTargetHelper)

Просмотреть файл

@ -39,13 +39,14 @@ namespace {
class TransportTestPeer;
class SendPeriodic : public nsITimerCallback {
class SendPeriodic : public nsITimerCallback, public nsINamed {
public:
SendPeriodic(TransportTestPeer* peer, int to_send)
: peer_(peer), to_send_(to_send) {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
protected:
virtual ~SendPeriodic() = default;
@ -54,7 +55,7 @@ class SendPeriodic : public nsITimerCallback {
int to_send_;
};
NS_IMPL_ISUPPORTS(SendPeriodic, nsITimerCallback)
NS_IMPL_ISUPPORTS(SendPeriodic, nsITimerCallback, nsINamed)
class TransportTestPeer : public sigslot::has_slots<> {
public:
@ -309,6 +310,12 @@ NS_IMETHODIMP SendPeriodic::Notify(nsITimer* timer) {
return NS_OK;
}
NS_IMETHODIMP
SendPeriodic::GetName(nsACString& aName) {
aName.AssignLiteral("SendPeriodic");
return NS_OK;
}
class SctpTransportTest : public MtransportTest {
public:
SctpTransportTest() = default;

Просмотреть файл

@ -371,6 +371,12 @@ ReportDeliver::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
ReportDeliver::GetName(nsACString& aName) {
aName.AssignLiteral("ReportDeliver");
return NS_OK;
}
NS_IMETHODIMP
ReportDeliver::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
@ -400,6 +406,7 @@ NS_INTERFACE_MAP_BEGIN(ReportDeliver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(ReportDeliver)

Просмотреть файл

@ -23,11 +23,14 @@ namespace dom {
class ReportBody;
class ReportDeliver final : public nsIObserver, public nsITimerCallback {
class ReportDeliver final : public nsIObserver,
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
struct ReportData {
nsString mType;

Просмотреть файл

@ -732,6 +732,12 @@ ReportingHeader::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
ReportingHeader::GetName(nsACString& aName) {
aName.AssignLiteral("ReportingHeader");
return NS_OK;
}
void ReportingHeader::MaybeCreateCleanupTimer() {
if (mCleanupTimer) {
return;
@ -765,6 +771,7 @@ NS_INTERFACE_MAP_BEGIN(ReportingHeader)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(ReportingHeader)

Просмотреть файл

@ -27,11 +27,14 @@ class PrincipalInfo;
namespace dom {
class ReportingHeader final : public nsIObserver, public nsITimerCallback {
class ReportingHeader final : public nsIObserver,
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
static void Initialize();

Просмотреть файл

@ -19,7 +19,8 @@ namespace dom {
using mozilla::ipc::AssertIsOnBackgroundThread;
class ServiceWorkerRegistrationProxy::DelayedUpdate final
: public nsITimerCallback {
: public nsITimerCallback,
public nsINamed {
RefPtr<ServiceWorkerRegistrationProxy> mProxy;
RefPtr<ServiceWorkerRegistrationPromise::Private> mPromise;
nsCOMPtr<nsITimer> mTimer;
@ -30,6 +31,7 @@ class ServiceWorkerRegistrationProxy::DelayedUpdate final
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
DelayedUpdate(RefPtr<ServiceWorkerRegistrationProxy>&& aProxy,
RefPtr<ServiceWorkerRegistrationPromise::Private>&& aPromise,
@ -261,7 +263,7 @@ class UpdateCallback final : public ServiceWorkerUpdateFinishCallback {
} // anonymous namespace
NS_IMPL_ISUPPORTS(ServiceWorkerRegistrationProxy::DelayedUpdate,
nsITimerCallback)
nsITimerCallback, nsINamed)
ServiceWorkerRegistrationProxy::DelayedUpdate::DelayedUpdate(
RefPtr<ServiceWorkerRegistrationProxy>&& aProxy,
@ -330,6 +332,12 @@ ServiceWorkerRegistrationProxy::DelayedUpdate::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
ServiceWorkerRegistrationProxy::DelayedUpdate::GetName(nsACString& aName) {
aName.AssignLiteral("ServiceWorkerRegistrationProxy::DelayedUpdate");
return NS_OK;
}
RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerRegistrationProxy::Update(
const nsCString& aNewestWorkerScriptUrl) {
AssertIsOnBackgroundThread();

Просмотреть файл

@ -24,7 +24,7 @@ namespace mozilla {
namespace dom {
NS_IMPL_ISUPPORTS(ServiceWorkerShutdownBlocker, nsIAsyncShutdownBlocker,
nsITimerCallback)
nsITimerCallback, nsINamed)
NS_IMETHODIMP ServiceWorkerShutdownBlocker::GetName(nsAString& aNameOut) {
aNameOut = nsLiteralString(
@ -32,6 +32,12 @@ NS_IMETHODIMP ServiceWorkerShutdownBlocker::GetName(nsAString& aNameOut) {
return NS_OK;
}
// nsINamed implementation
NS_IMETHODIMP ServiceWorkerShutdownBlocker::GetName(nsACString& aNameOut) {
aNameOut.AssignLiteral("ServiceWorkerShutdownBlocker");
return NS_OK;
}
NS_IMETHODIMP
ServiceWorkerShutdownBlocker::BlockShutdown(nsIAsyncShutdownClient* aClient) {
AssertIsOnMainThread();

Просмотреть файл

@ -42,7 +42,8 @@ class ServiceWorkerManager;
* shutdown will be forcefully unblocked.
*/
class ServiceWorkerShutdownBlocker final : public nsIAsyncShutdownBlocker,
public nsITimerCallback {
public nsITimerCallback,
public nsINamed {
public:
using Progress = ServiceWorkerShutdownState::Progress;
static const uint32_t kInvalidShutdownStateId = 0;
@ -50,6 +51,7 @@ class ServiceWorkerShutdownBlocker final : public nsIAsyncShutdownBlocker,
NS_DECL_ISUPPORTS
NS_DECL_NSIASYNCSHUTDOWNBLOCKER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
/**
* Returns the registered shutdown blocker if registration succeeded and

Просмотреть файл

@ -244,6 +244,12 @@ StorageActivityService::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
StorageActivityService::GetName(nsACString& aName) {
aName.AssignLiteral("StorageActivityService");
return NS_OK;
}
NS_IMETHODIMP
StorageActivityService::GetActiveOrigins(PRTime aFrom, PRTime aTo,
nsIArray** aRetval) {
@ -304,6 +310,7 @@ NS_INTERFACE_MAP_BEGIN(StorageActivityService)
NS_INTERFACE_MAP_ENTRY(nsIStorageActivityService)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_END

Просмотреть файл

@ -24,12 +24,14 @@ namespace dom {
class StorageActivityService final : public nsIStorageActivityService,
public nsIObserver,
public nsITimerCallback,
public nsINamed,
public nsSupportsWeakReference {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISTORAGEACTIVITYSERVICE
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
// Main-thread only.
static void SendActivity(nsIPrincipal* aPrincipal);

Просмотреть файл

@ -731,6 +731,11 @@ Result<Ok, nsresult> ScriptPreloader::WriteCache() {
return Ok();
}
nsresult ScriptPreloader::GetName(nsACString& aName) {
aName.AssignLiteral("ScriptPreloader");
return NS_OK;
}
// Runs in the mSaveThread thread, and writes out the cache file for the next
// session after a reasonable delay.
nsresult ScriptPreloader::Run() {
@ -1265,7 +1270,7 @@ already_AddRefed<nsIAsyncShutdownClient> ScriptPreloader::GetShutdownBarrier() {
}
NS_IMPL_ISUPPORTS(ScriptPreloader, nsIObserver, nsIRunnable, nsIMemoryReporter,
nsIAsyncShutdownBlocker)
nsINamed, nsIAsyncShutdownBlocker)
#undef LOG

Просмотреть файл

@ -68,6 +68,7 @@ using namespace mozilla::loader;
class ScriptPreloader : public nsIObserver,
public nsIMemoryReporter,
public nsIRunnable,
public nsINamed,
public nsIAsyncShutdownBlocker {
MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
@ -78,6 +79,7 @@ class ScriptPreloader : public nsIObserver,
NS_DECL_NSIOBSERVER
NS_DECL_NSIMEMORYREPORTER
NS_DECL_NSIRUNNABLE
NS_DECL_NSINAMED
NS_DECL_NSIASYNCSHUTDOWNBLOCKER
static ScriptPreloader& GetSingleton();

Просмотреть файл

@ -40,11 +40,14 @@ static StaticRefPtr<RequestContextService> gSingleton;
static bool sShutdown = false;
// nsIRequestContext
class RequestContext final : public nsIRequestContext, public nsITimerCallback {
class RequestContext final : public nsIRequestContext,
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIREQUESTCONTEXT
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
explicit RequestContext(const uint64_t id);
@ -90,7 +93,7 @@ class RequestContext final : public nsIRequestContext, public nsITimerCallback {
bool mAfterDOMContentLoaded;
};
NS_IMPL_ISUPPORTS(RequestContext, nsIRequestContext, nsITimerCallback)
NS_IMPL_ISUPPORTS(RequestContext, nsIRequestContext, nsITimerCallback, nsINamed)
RequestContext::RequestContext(const uint64_t aID)
: mID(aID),
@ -324,6 +327,12 @@ RequestContext::Notify(nsITimer* timer) {
return NS_OK;
}
NS_IMETHODIMP
RequestContext::GetName(nsACString& aName) {
aName.AssignLiteral("RequestContext");
return NS_OK;
}
NS_IMETHODIMP
RequestContext::IsContextTailBlocked(nsIRequestTailUnblockCallback* aRequest,
bool* aBlocked) {

Просмотреть файл

@ -763,6 +763,7 @@ NS_INTERFACE_MAP_BEGIN(nsProtocolProxyService)
NS_INTERFACE_MAP_ENTRY(nsIProtocolProxyService2)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_ENTRY_CONCRETE(nsProtocolProxyService)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIProtocolProxyService)
NS_IMPL_QUERY_CLASSINFO(nsProtocolProxyService)
@ -945,6 +946,12 @@ nsProtocolProxyService::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
nsProtocolProxyService::GetName(nsACString& aName) {
aName.AssignLiteral("nsProtocolProxyService");
return NS_OK;
}
void nsProtocolProxyService::PrefsChanged(nsIPrefBranch* prefBranch,
const char* pref) {
nsresult rv = NS_OK;

Просмотреть файл

@ -42,13 +42,15 @@ struct nsProtocolInfo;
class nsProtocolProxyService final : public nsIProtocolProxyService2,
public nsIObserver,
public nsITimerCallback {
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPROTOCOLPROXYSERVICE2
NS_DECL_NSIPROTOCOLPROXYSERVICE
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PROTOCOL_PROXY_SERVICE_IMPL_CID)

Просмотреть файл

@ -718,7 +718,7 @@ int32_t nsSocketTransportService::Poll(TimeDuration* pollDuration,
NS_IMPL_ISUPPORTS(nsSocketTransportService, nsISocketTransportService,
nsIRoutedSocketTransportService, nsIEventTarget,
nsISerialEventTarget, nsIThreadObserver, nsIRunnable,
nsPISocketTransportService, nsIObserver,
nsPISocketTransportService, nsIObserver, nsINamed,
nsIDirectTaskDispatcher)
static const char* gCallbackPrefs[] = {
@ -1551,6 +1551,12 @@ void nsSocketTransportService::NotifyKeepaliveEnabledPrefChange(
sock->mHandler->OnKeepaliveEnabledPrefChange(mKeepaliveEnabledPref);
}
NS_IMETHODIMP
nsSocketTransportService::GetName(nsACString& aName) {
aName.AssignLiteral("nsSocketTransportService");
return NS_OK;
}
NS_IMETHODIMP
nsSocketTransportService::Observe(nsISupports* subject, const char* topic,
const char16_t* data) {

Просмотреть файл

@ -88,6 +88,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
public nsIThreadObserver,
public nsIRunnable,
public nsIObserver,
public nsINamed,
public nsIDirectTaskDispatcher {
public:
NS_DECL_THREADSAFE_ISUPPORTS
@ -98,6 +99,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
NS_DECL_NSITHREADOBSERVER
NS_DECL_NSIRUNNABLE
NS_DECL_NSIOBSERVER
NS_DECL_NSINAMED
NS_DECL_NSIDIRECTTASKDISPATCHER
static const uint32_t SOCKET_LIMIT_MIN = 50U;

Просмотреть файл

@ -53,7 +53,7 @@ already_AddRefed<CookieServiceChild> CookieServiceChild::GetSingleton() {
}
NS_IMPL_ISUPPORTS(CookieServiceChild, nsICookieService, nsIObserver,
nsITimerCallback, nsISupportsWeakReference)
nsITimerCallback, nsINamed, nsISupportsWeakReference)
CookieServiceChild::CookieServiceChild() {
NS_ASSERTION(IsNeckoChild(), "not a child process");
@ -116,6 +116,12 @@ CookieServiceChild::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
CookieServiceChild::GetName(nsACString& aName) {
aName.AssignLiteral("CookieServiceChild");
return NS_OK;
}
CookieServiceChild::~CookieServiceChild() { gCookieChildService = nullptr; }
void CookieServiceChild::TrackCookieLoad(nsIChannel* aChannel) {

Просмотреть файл

@ -29,6 +29,7 @@ class CookieServiceChild final : public PCookieServiceChild,
public nsICookieService,
public nsIObserver,
public nsITimerCallback,
public nsINamed,
public nsSupportsWeakReference {
friend class PCookieServiceChild;
@ -37,6 +38,7 @@ class CookieServiceChild final : public PCookieServiceChild,
NS_DECL_NSICOOKIESERVICE
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
typedef nsTArray<RefPtr<Cookie>> CookiesList;
typedef nsClassHashtable<CookieKey, CookiesList> CookiesMap;

Просмотреть файл

@ -32,7 +32,7 @@ namespace net {
ODoHService* gODoHService = nullptr;
NS_IMPL_ISUPPORTS(ODoHService, nsIDNSListener, nsIObserver,
nsISupportsWeakReference, nsITimerCallback,
nsISupportsWeakReference, nsITimerCallback, nsINamed,
nsIStreamLoaderObserver)
ODoHService::ODoHService()
@ -351,6 +351,12 @@ ODoHService::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
ODoHService::GetName(nsACString& aName) {
aName.AssignLiteral("ODoHService");
return NS_OK;
}
void ODoHService::ODoHConfigUpdateDone(uint32_t aTTL,
Span<const uint8_t> aRawConfig) {
MOZ_ASSERT_IF(XRE_IsParentProcess() && TRRService::Get(),

Просмотреть файл

@ -25,12 +25,14 @@ class ODoHService : public nsIDNSListener,
public nsIObserver,
public nsSupportsWeakReference,
public nsITimerCallback,
public nsINamed,
public nsIStreamLoaderObserver {
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIDNSLISTENER
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_NSISTREAMLOADEROBSERVER
ODoHService();

Просмотреть файл

@ -64,7 +64,8 @@ NS_IMPL_ISUPPORTS(TRRService, nsIObserver, nsISupportsWeakReference)
NS_IMPL_ADDREF_USING_AGGREGATOR(TRRService::ConfirmationContext, OwningObject())
NS_IMPL_RELEASE_USING_AGGREGATOR(TRRService::ConfirmationContext,
OwningObject())
NS_IMPL_QUERY_INTERFACE(TRRService::ConfirmationContext, nsITimerCallback)
NS_IMPL_QUERY_INTERFACE(TRRService::ConfirmationContext, nsITimerCallback,
nsINamed)
TRRService::TRRService() { MOZ_ASSERT(NS_IsMainThread(), "wrong thread"); }
@ -1044,6 +1045,12 @@ TRRService::ConfirmationContext::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
TRRService::ConfirmationContext::GetName(nsACString& aName) {
aName.AssignLiteral("TRRService::ConfirmationContext");
return NS_OK;
}
static char StatusToChar(nsresult aLookupStatus, nsresult aChannelStatus) {
// If the resolution fails in the TRR channel then we'll have a failed
// aChannelStatus. Otherwise, we parse the response - if it's not a valid DNS

Просмотреть файл

@ -187,9 +187,10 @@ class TRRService : public TRRServiceBase,
CONFIRM_DISABLED = 5,
};
class ConfirmationContext final : public nsITimerCallback {
class ConfirmationContext final : public nsITimerCallback, public nsINamed {
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
private:
static const size_t RESULTS_SIZE = 32;

Просмотреть файл

@ -5352,6 +5352,7 @@ NS_INTERFACE_MAP_BEGIN(nsHttpChannel)
NS_INTERFACE_MAP_ENTRY(nsICorsPreflightCallback)
NS_INTERFACE_MAP_ENTRY(nsIRaceCacheWithNetwork)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_ENTRY(nsIRequestTailUnblockCallback)
NS_INTERFACE_MAP_ENTRY_CONCRETE(nsHttpChannel)
NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
@ -5488,7 +5489,8 @@ nsresult nsHttpChannel::CancelInternal(nsresult status) {
mCanceled = true;
mStatus = NS_FAILED(status) ? status : NS_ERROR_ABORT;
if (mLastStatusReported && !mEndMarkerAdded && profiler_can_accept_markers()) {
if (mLastStatusReported && !mEndMarkerAdded &&
profiler_can_accept_markers()) {
// These do allocations/frees/etc; avoid if not active
// mLastStatusReported can be null if Cancel is called before we added the
// start marker.
@ -5807,8 +5809,7 @@ nsHttpChannel::AsyncOpen(nsIStreamListener* aListener) {
void nsHttpChannel::AsyncOpenFinal(TimeStamp aTimeStamp) {
// We save this timestamp from outside of the if block in case we enable the
// profiler after AsyncOpen().
mLastStatusReported =
TimeStamp::Now();
mLastStatusReported = TimeStamp::Now();
if (profiler_can_accept_markers()) {
nsAutoCString requestMethod;
GetRequestMethod(requestMethod);
@ -9090,6 +9091,12 @@ nsHttpChannel::Test_triggerNetwork(int32_t aTimeout) {
return TriggerNetworkWithDelay(aTimeout);
}
NS_IMETHODIMP
nsHttpChannel::GetName(nsACString& aName) {
aName.AssignLiteral("nsHttpChannel");
return NS_OK;
}
NS_IMETHODIMP
nsHttpChannel::Notify(nsITimer* aTimer) {
RefPtr<nsHttpChannel> self(this);

Просмотреть файл

@ -75,7 +75,8 @@ class nsHttpChannel final : public HttpBaseChannel,
public nsICorsPreflightCallback,
public nsIRaceCacheWithNetwork,
public nsIRequestTailUnblockCallback,
public nsITimerCallback {
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIREQUESTOBSERVER
@ -93,6 +94,7 @@ class nsHttpChannel final : public HttpBaseChannel,
NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTPCHANNEL_IID)
NS_DECL_NSIRACECACHEWITHNETWORK
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_NSIREQUESTTAILUNBLOCKCALLBACK
// nsIHttpAuthenticableChannel. We can't use

Просмотреть файл

@ -49,7 +49,7 @@ namespace net {
//-----------------------------------------------------------------------------
NS_IMPL_ISUPPORTS(nsHttpConnectionMgr, nsIObserver)
NS_IMPL_ISUPPORTS(nsHttpConnectionMgr, nsIObserver, nsINamed)
//-----------------------------------------------------------------------------
@ -250,6 +250,16 @@ void nsHttpConnectionMgr::ConditionallyStopTimeoutTick() {
mTimeoutTickArmed = false;
}
//-----------------------------------------------------------------------------
// nsHttpConnectionMgr::nsINamed
//-----------------------------------------------------------------------------
NS_IMETHODIMP
nsHttpConnectionMgr::GetName(nsACString& aName) {
aName.AssignLiteral("nsHttpConnectionMgr");
return NS_OK;
}
//-----------------------------------------------------------------------------
// nsHttpConnectionMgr::nsIObserver
//-----------------------------------------------------------------------------

Просмотреть файл

@ -40,11 +40,13 @@ class nsHttpConnectionMgr;
using nsConnEventHandler = void (nsHttpConnectionMgr::*)(int32_t, ARefBase*);
class nsHttpConnectionMgr final : public HttpConnectionMgrShell,
public nsIObserver {
public nsIObserver,
nsINamed {
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_HTTPCONNECTIONMGRSHELL
NS_DECL_NSIOBSERVER
NS_DECL_NSINAMED
//-------------------------------------------------------------------------
// NOTE: functions below may only be called on the main thread.

Просмотреть файл

@ -2767,7 +2767,7 @@ nsHttpTransaction::Release() {
}
NS_IMPL_QUERY_INTERFACE(nsHttpTransaction, nsIInputStreamCallback,
nsIOutputStreamCallback, nsITimerCallback)
nsIOutputStreamCallback, nsITimerCallback, nsINamed)
//-----------------------------------------------------------------------------
// nsHttpTransaction::nsIInputStreamCallback
@ -3329,6 +3329,12 @@ nsHttpTransaction::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
nsHttpTransaction::GetName(nsACString& aName) {
aName.AssignLiteral("nsHttpTransaction");
return NS_OK;
}
bool nsHttpTransaction::GetSupportsHTTP3() { return mSupportsHTTP3; }
const int64_t TELEMETRY_REQUEST_SIZE_10M = (int64_t)10 * (int64_t)(1 << 20);

Просмотреть файл

@ -56,7 +56,8 @@ class nsHttpTransaction final : public nsAHttpTransaction,
public nsIInputStreamCallback,
public nsIOutputStreamCallback,
public ARefBase,
public nsITimerCallback {
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSAHTTPTRANSACTION
@ -64,6 +65,7 @@ class nsHttpTransaction final : public nsAHttpTransaction,
NS_DECL_NSIINPUTSTREAMCALLBACK
NS_DECL_NSIOUTPUTSTREAMCALLBACK
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
nsHttpTransaction();

Просмотреть файл

@ -20,12 +20,14 @@ using prefix_and_netmask = std::pair<in6_addr, in6_addr>;
class nsNetworkLinkService : public nsINetworkLinkService,
public nsIObserver,
public nsITimerCallback {
public nsITimerCallback,
public nsINamed {
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSINETWORKLINKSERVICE
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
nsNetworkLinkService();

Просмотреть файл

@ -85,7 +85,8 @@ static void CFReleaseSafe(CFTypeRef cf) {
}
}
NS_IMPL_ISUPPORTS(nsNetworkLinkService, nsINetworkLinkService, nsIObserver, nsITimerCallback)
NS_IMPL_ISUPPORTS(nsNetworkLinkService, nsINetworkLinkService, nsIObserver, nsITimerCallback,
nsINamed)
nsNetworkLinkService::nsNetworkLinkService()
: mLinkUp(true),
@ -582,6 +583,12 @@ nsNetworkLinkService::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
nsNetworkLinkService::GetName(nsACString& aName) {
aName.AssignLiteral("nsNetworkLinkService");
return NS_OK;
}
void nsNetworkLinkService::calculateNetworkIdInternal(void) {
MOZ_ASSERT(!NS_IsMainThread(), "Should not be called on the main thread");
SHA1Sum sha1;

Просмотреть файл

@ -194,7 +194,7 @@ UDPServerListener::OnStopListening(nsIUDPSocket*, nsresult) {
/**
* Multicast timer callback: detects delivery failure
*/
class MulticastTimerCallback : public nsITimerCallback {
class MulticastTimerCallback : public nsITimerCallback, public nsINamed {
protected:
virtual ~MulticastTimerCallback();
@ -204,12 +204,13 @@ class MulticastTimerCallback : public nsITimerCallback {
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
nsresult mResult;
RefPtr<WaitForCondition> mWaiter;
};
NS_IMPL_ISUPPORTS(MulticastTimerCallback, nsITimerCallback)
NS_IMPL_ISUPPORTS(MulticastTimerCallback, nsITimerCallback, nsINamed)
MulticastTimerCallback::~MulticastTimerCallback() = default;
@ -225,6 +226,12 @@ MulticastTimerCallback::Notify(nsITimer* timer) {
return NS_OK;
}
NS_IMETHODIMP
MulticastTimerCallback::GetName(nsACString& aName) {
aName.AssignLiteral("MulticastTimerCallback");
return NS_OK;
}
/**** Main ****/
TEST(TestUDPSocket, TestUDPSocketMain)

Просмотреть файл

@ -588,6 +588,7 @@ class PendingDBLookup;
// This class is private to ApplicationReputationService.
class PendingLookup final : public nsIStreamListener,
public nsITimerCallback,
public nsINamed,
public nsIObserver,
public nsSupportsWeakReference {
public:
@ -595,6 +596,7 @@ class PendingLookup final : public nsIStreamListener,
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_NSIOBSERVER
// Constructor and destructor.
@ -876,7 +878,8 @@ PendingDBLookup::HandleEvent(const nsACString& tables) {
}
NS_IMPL_ISUPPORTS(PendingLookup, nsIStreamListener, nsIRequestObserver,
nsIObserver, nsISupportsWeakReference, nsITimerCallback)
nsIObserver, nsISupportsWeakReference, nsITimerCallback,
nsINamed)
PendingLookup::PendingLookup(nsIApplicationReputationQuery* aQuery,
nsIApplicationReputationCallback* aCallback)
@ -1709,6 +1712,12 @@ PendingLookup::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
PendingLookup::GetName(nsACString& aName) {
aName.AssignLiteral("PendingLookup");
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIObserver implementation
NS_IMETHODIMP

Просмотреть файл

@ -24,12 +24,19 @@ NS_IMPL_CYCLE_COLLECTION(SessionStoreDataCollector, mWindowChild, mTimer)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SessionStoreDataCollector)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsINamed)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITimerCallback)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(SessionStoreDataCollector)
NS_IMPL_CYCLE_COLLECTING_RELEASE(SessionStoreDataCollector)
NS_IMETHODIMP
SessionStoreDataCollector::GetName(nsACString& aName) {
aName.AssignLiteral("SessionStoreDataCollector");
return NS_OK;
}
NS_IMETHODIMP
SessionStoreDataCollector::Notify(nsITimer* aTimer) {
Collect();

Просмотреть файл

@ -25,11 +25,14 @@ namespace sessionstore {
class FormData;
}
class SessionStoreDataCollector final : public nsITimerCallback {
class SessionStoreDataCollector final : public nsITimerCallback,
public nsINamed {
public:
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(SessionStoreDataCollector)
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(SessionStoreDataCollector,
nsITimerCallback)
enum class Change { Input, Scroll };

Просмотреть файл

@ -215,7 +215,7 @@ ViaductRequest::~ViaductRequest() {
NotifyMonitor();
}
NS_IMPL_ISUPPORTS(ViaductRequest, nsIStreamListener, nsITimerCallback,
NS_IMPL_ISUPPORTS(ViaductRequest, nsIStreamListener, nsITimerCallback, nsINamed,
nsIChannelEventSink)
///////////////////////////////////////////////////////////////////////////////
@ -320,4 +320,13 @@ ViaductRequest::Notify(nsITimer* timer) {
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsINamed implementation
NS_IMETHODIMP
ViaductRequest::GetName(nsACString& aName) {
aName.AssignLiteral("ViaductRequest");
return NS_OK;
}
}; // namespace mozilla

Просмотреть файл

@ -19,12 +19,14 @@ namespace mozilla {
class ViaductRequest final : public nsIStreamListener,
public nsITimerCallback,
public nsINamed,
public nsIChannelEventSink {
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
NS_DECL_NSICHANNELEVENTSINK
ViaductRequest()

Просмотреть файл

@ -343,7 +343,7 @@ nsCString PreloaderBase::RedirectRecord::Fragment() const {
// PreloaderBase::UsageTimer
NS_IMPL_ISUPPORTS(PreloaderBase::UsageTimer, nsITimerCallback)
NS_IMPL_ISUPPORTS(PreloaderBase::UsageTimer, nsITimerCallback, nsINamed)
NS_IMETHODIMP PreloaderBase::UsageTimer::Notify(nsITimer* aTimer) {
if (!mPreload || !mDocument) {
@ -377,4 +377,10 @@ NS_IMETHODIMP PreloaderBase::UsageTimer::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
PreloaderBase::UsageTimer::GetName(nsACString& aName) {
aName.AssignLiteral("PreloaderBase::UsageTimer");
return NS_OK;
}
} // namespace mozilla

Просмотреть файл

@ -151,9 +151,10 @@ class PreloaderBase : public SupportsWeakPtr, public nsISupports {
class RedirectSink;
// A timer callback to trigger the unuse warning for this preload
class UsageTimer final : public nsITimerCallback {
class UsageTimer final : public nsITimerCallback, public nsINamed {
NS_DECL_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
UsageTimer(PreloaderBase* aPreload, dom::Document* aDocument);

Просмотреть файл

@ -30,11 +30,13 @@ namespace mozilla {
// user-interaction events from the observer service.
class nsAvailableMemoryWatcher final : public nsIObserver,
public nsITimerCallback,
public nsINamed,
public nsAvailableMemoryWatcherBase {
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK
NS_DECL_NSINAMED
nsAvailableMemoryWatcher();
nsresult Init(uint32_t aPollingInterval);
@ -99,7 +101,7 @@ const char* const nsAvailableMemoryWatcher::kObserverTopics[] = {
NS_IMPL_ISUPPORTS_INHERITED(nsAvailableMemoryWatcher,
nsAvailableMemoryWatcherBase, nsIObserver,
nsITimerCallback)
nsITimerCallback, nsINamed)
nsAvailableMemoryWatcher::nsAvailableMemoryWatcher()
: mMutex("low memory callback mutex"),
@ -388,6 +390,12 @@ nsAvailableMemoryWatcher::Notify(nsITimer* aTimer) {
return NS_OK;
}
NS_IMETHODIMP
nsAvailableMemoryWatcher::GetName(nsACString& aName) {
aName.AssignLiteral("nsAvailableMemoryWatcher");
return NS_OK;
}
// Observer service callback, used to stop the polling timer when the user
// stops interacting with Firefox and resuming it when they interact again.
// Also used to shut down the service if the application is quitting.

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "nsINamed.idl"
interface nsIObserver;
interface nsIEventTarget;
@ -318,4 +319,12 @@ NS_NewTimerWithFuncCallback(nsTimerCallbackFunc aCallback,
#define NS_TIMER_CONTRACTID "@mozilla.org/timer;1"
#define NS_TIMER_CALLBACK_TOPIC "timer-callback"
#undef NS_DECL_NSITIMERCALLBACK
#define NS_DECL_NSITIMERCALLBACK \
NS_IMETHOD Notify(nsITimer *timer) override; \
inline void _ensure_GetName_exists(void) { \
static_assert(std::is_convertible<decltype(this), nsINamed*>::value, \
"nsITimerCallback implementations must also implement nsINamed"); \
}
%}