Bug 1620097 - Add markers and labels for category service observer notifications. r=florian

Differential Revision: https://phabricator.services.mozilla.com/D66074

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2020-03-17 04:11:35 +00:00
Родитель 44ece05dfd
Коммит 93518320ab
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -21,6 +21,7 @@
#include "nsIObserverService.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "nsPrintfCString.h"
#include "nsQuickSort.h"
#include "nsEnumeratorUtils.h"
#include "nsThreadUtils.h"
@ -29,6 +30,7 @@
#include "mozilla/Services.h"
#include "mozilla/SimpleEnumerator.h"
#include "GeckoProfiler.h"
#include "ManifestParser.h"
#include "nsSimpleEnumerator.h"
@ -672,6 +674,16 @@ void NS_CreateServicesFromCategory(const char* aCategory, nsISupports* aOrigin,
// try an observer, if it implements it.
nsCOMPtr<nsIObserver> observer = do_QueryInterface(instance);
if (observer) {
#ifdef MOZ_GECKO_PROFILER
nsPrintfCString profilerStr("%s (%s)", aObserverTopic,
entryString.get());
AUTO_PROFILER_TEXT_MARKER_CAUSE("Category observer notification",
profilerStr, OTHER, Nothing(),
profiler_get_backtrace());
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING_NONSENSITIVE(
"Category observer notification -", OTHER, profilerStr);
#endif
observer->Observe(aOrigin, aObserverTopic,
aObserverData ? aObserverData : u"");
} else {