Bug 1347348 (part 5) - Remove an unnecessary profiler_is_active() calls. r=mstange.

profiler_get_profile() will return nullptr is the profiler is not active, so
there's no need to call profiler_is_active() just beforehand.

--HG--
extra : rebase_source : 9b7d4396599dc10230c5215492c9f63c48a4ff5e
This commit is contained in:
Nicholas Nethercote 2017-03-07 16:55:00 +11:00
Родитель 1b01d89d14
Коммит e981884dca
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -48,11 +48,6 @@ ANRReporter::RequestNativeStack(bool aUnwind)
jni::String::LocalRef
ANRReporter::GetNativeStack()
{
if (!profiler_is_active()) {
// Maybe profiler support is disabled?
return nullptr;
}
// Timeout if we don't get a profiler sample after 5 seconds.
const PRIntervalTime timeout = PR_SecondsToInterval(5);
const PRIntervalTime startTime = PR_IntervalNow();
@ -60,7 +55,12 @@ ANRReporter::GetNativeStack()
// Pointer to a profile JSON string
typedef mozilla::UniquePtr<char[]> ProfilePtr;
// profiler_get_profile() will return nullptr if the profiler is disabled
// or inactive.
ProfilePtr profile(profiler_get_profile());
if (!profile) {
return nullptr;
}
while (profile && !strstr(profile.get(), "\"samples\":[{")) {
// no sample yet?