Bug 1667915 - Separate marker category from marker options - r=gregtatum

The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
This commit is contained in:
Gerald Squelart
2020-10-01 11:02:23 +00:00
parent 095be27963
commit 313fddf4f9
28 changed files with 382 additions and 362 deletions

View File

@@ -265,10 +265,9 @@ void ChannelWrapper::Resume(const nsCString& aText, ErrorResult& aRv) {
if (nsCOMPtr<nsIChannel> chan = MaybeChannel()) {
rv = chan->Resume();
PROFILER_MARKER_TEXT(
"Extension Suspend",
NETWORK.WithOptions(MarkerTiming::IntervalUntilNowFrom(mSuspendTime)),
aText);
PROFILER_MARKER_TEXT("Extension Suspend", NETWORK,
MarkerTiming::IntervalUntilNowFrom(mSuspendTime),
aText);
}
if (NS_FAILED(rv)) {
aRv.Throw(rv);