зеркало из https://github.com/mozilla/gecko-dev.git
Bug 971094 - Part 0: Add some null checks to the profiler's usage of Observation::Filename(). r=BenWa
This commit is contained in:
Родитель
26c11fe0c7
Коммит
00487ce6f9
|
@ -36,11 +36,15 @@ void ProfilerIOInterposeObserver::Observe(Observation& aObservation)
|
|||
}
|
||||
ProfilerBacktrace* stack = profiler_get_backtrace();
|
||||
|
||||
IOMarkerPayload* markerPayload = new IOMarkerPayload(
|
||||
aObservation.Reference(),
|
||||
NS_ConvertUTF16toUTF8(aObservation.Filename()).get(),
|
||||
aObservation.Start(),
|
||||
aObservation.End(),
|
||||
stack);
|
||||
nsCString filename;
|
||||
if (aObservation.Filename()) {
|
||||
filename = NS_ConvertUTF16toUTF8(aObservation.Filename());
|
||||
}
|
||||
|
||||
IOMarkerPayload* markerPayload = new IOMarkerPayload(aObservation.Reference(),
|
||||
filename.get(),
|
||||
aObservation.Start(),
|
||||
aObservation.End(),
|
||||
stack);
|
||||
PROFILER_MARKER_PAYLOAD(str, markerPayload);
|
||||
}
|
||||
|
|
|
@ -115,9 +115,9 @@ IOMarkerPayload::IOMarkerPayload(const char* aSource,
|
|||
const mozilla::TimeStamp& aEndTime,
|
||||
ProfilerBacktrace* aStack)
|
||||
: ProfilerMarkerPayload(aStartTime, aEndTime, aStack),
|
||||
mSource(aSource),
|
||||
mFilename(strdup(aFilename))
|
||||
mSource(aSource)
|
||||
{
|
||||
mFilename = aFilename ? strdup(aFilename) : nullptr;
|
||||
MOZ_ASSERT(aSource);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче