Bug 1614013 - Fix RAII Profiler object scopes - r=gregtatum

In bug 1578329 I introduced two scoping mistakes:
- A marker was made to have a shorter duration.
- A label was scoped too short and so would most likely be missed during
  sampling.
This patch reverts to the original wider scope.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gerald Squelart 2020-02-10 20:44:33 +00:00
parent 0044ed8301
commit fbbc5d66db
2 changed files with 8 additions and 8 deletions

View File

@ -5888,8 +5888,8 @@ bool nsGlobalWindowInner::RunTimeoutHandler(Timeout* aTimeout,
const char* reason = GetTimeoutReasonString(timeout); const char* reason = GetTimeoutReasonString(timeout);
#ifdef MOZ_GECKO_PROFILER #ifdef MOZ_GECKO_PROFILER
nsCString str;
if (profiler_can_accept_markers()) { if (profiler_can_accept_markers()) {
nsCString str;
TimeDuration originalInterval = timeout->When() - timeout->SubmitTime(); TimeDuration originalInterval = timeout->When() - timeout->SubmitTime();
str.Append(reason); str.Append(reason);
str.Append(" with interval "); str.Append(" with interval ");
@ -5898,10 +5898,10 @@ bool nsGlobalWindowInner::RunTimeoutHandler(Timeout* aTimeout,
nsCString handlerDescription; nsCString handlerDescription;
timeout->mScriptHandler->GetDescription(handlerDescription); timeout->mScriptHandler->GetDescription(handlerDescription);
str.Append(handlerDescription); str.Append(handlerDescription);
AUTO_PROFILER_TEXT_MARKER_CAUSE("setTimeout callback", str, JS,
Some(mWindowID),
timeout->TakeProfilerBacktrace());
} }
AUTO_PROFILER_TEXT_MARKER_CAUSE("setTimeout callback", str, JS,
Some(mWindowID),
timeout->TakeProfilerBacktrace());
#endif #endif
bool abortIntervalHandler; bool abortIntervalHandler;

View File

@ -1741,12 +1741,12 @@ void gfxFontFamily::FindFontForChar(GlobalFontMatch* aMatchData) {
} }
#ifdef MOZ_GECKO_PROFILER #ifdef MOZ_GECKO_PROFILER
nsCString charAndName;
if (profiler_can_accept_markers()) { if (profiler_can_accept_markers()) {
nsCString charAndName = charAndName = nsPrintfCString("\\u%x %s", aMatchData->mCh, mName.get());
nsPrintfCString("\\u%x %s", aMatchData->mCh, mName.get());
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("gfxFontFamily::FindFontForChar",
LAYOUT, charAndName);
} }
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("gfxFontFamily::FindFontForChar",
LAYOUT, charAndName);
#endif #endif
AutoTArray<gfxFontEntry*, 4> entries; AutoTArray<gfxFontEntry*, 4> entries;