Bug 1571348 - ProfilerMarkerPayload::Set...() can be replaced with constructor arguments - r=gregtatum

`ProfilerMarkerPayload::Set...()` functions are only used by derived classes in
the same files, and these values could just be set during construction.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gerald Squelart 2019-08-07 01:53:55 +00:00
Родитель e7c694b138
Коммит a2e0f9390e
2 изменённых файлов: 10 добавлений и 41 удалений

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

@ -67,16 +67,6 @@ class ProfilerMarkerPayload {
const TimeStamp& aProcessStartTime,
UniqueStacks& aUniqueStacks);
void SetStack(UniqueProfilerBacktrace aStack) { mStack = std::move(aStack); }
void SetDocShellHistoryId(const Maybe<uint32_t>& aDocShellHistoryId) {
mDocShellHistoryId = aDocShellHistoryId;
}
void SetDocShellId(const Maybe<std::string>& aDocShellId) {
mDocShellId = aDocShellId;
}
private:
TimeStamp mStartTime;
TimeStamp mEndTime;
@ -99,13 +89,10 @@ class TracingMarkerPayload : public ProfilerMarkerPayload {
const Maybe<std::string>& aDocShellId = Nothing(),
const Maybe<uint32_t>& aDocShellHistoryId = Nothing(),
UniqueProfilerBacktrace aCause = nullptr)
: mCategory(aCategory), mKind(aKind) {
if (aCause) {
SetStack(std::move(aCause));
}
SetDocShellId(aDocShellId);
SetDocShellHistoryId(aDocShellHistoryId);
}
: ProfilerMarkerPayload(aDocShellId, aDocShellHistoryId,
std::move(aCause)),
mCategory(aCategory),
mKind(aKind) {}
DECL_BASE_STREAM_PAYLOAD

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

@ -74,17 +74,6 @@ class ProfilerMarkerPayload {
const mozilla::TimeStamp& aProcessStartTime,
UniqueStacks& aUniqueStacks);
void SetStack(UniqueProfilerBacktrace aStack) { mStack = std::move(aStack); }
void SetDocShellHistoryId(
const mozilla::Maybe<uint32_t>& aDocShellHistoryId) {
mDocShellHistoryId = aDocShellHistoryId;
}
void SetDocShellId(const mozilla::Maybe<nsID>& aDocShellId) {
mDocShellId = aDocShellId;
}
private:
mozilla::TimeStamp mStartTime;
mozilla::TimeStamp mEndTime;
@ -107,13 +96,10 @@ class TracingMarkerPayload : public ProfilerMarkerPayload {
const mozilla::Maybe<nsID>& aDocShellId = mozilla::Nothing(),
const mozilla::Maybe<uint32_t>& aDocShellHistoryId = mozilla::Nothing(),
UniqueProfilerBacktrace aCause = nullptr)
: mCategory(aCategory), mKind(aKind) {
if (aCause) {
SetStack(std::move(aCause));
}
SetDocShellId(aDocShellId);
SetDocShellHistoryId(aDocShellHistoryId);
}
: ProfilerMarkerPayload(aDocShellId, aDocShellHistoryId,
std::move(aCause)),
mCategory(aCategory),
mKind(aKind) {}
DECL_STREAM_PAYLOAD
@ -344,12 +330,8 @@ class StyleMarkerPayload : public ProfilerMarkerPayload {
const mozilla::Maybe<nsID>& aDocShellId,
const mozilla::Maybe<uint32_t>& aDocShellHistoryId)
: ProfilerMarkerPayload(aStartTime, aEndTime, aDocShellId,
aDocShellHistoryId),
mStats(aStats) {
if (aCause) {
SetStack(std::move(aCause));
}
}
aDocShellHistoryId, std::move(aCause)),
mStats(aStats) {}
DECL_STREAM_PAYLOAD