зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e7c694b138
Коммит
a2e0f9390e
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче