From 977ac8192b62106cc65417dc865422681d299001 Mon Sep 17 00:00:00 2001 From: Nathan Froyd <froydnj@mozilla.com> Date: Fri, 6 Jan 2017 09:21:01 -0500 Subject: [PATCH] Bug 1328370 - remove GeckoSampler::mPrimaryThreadProfile; r=mstange The only interesting setter of this field is GeckoSampler::GetPrimaryThreadProfile, which is unused. Once that function is removed, mPrimaryThreadProfile is set to null in GeckoSampler's constructor and never changed or referenced. --- tools/profiler/core/GeckoSampler.cpp | 1 - tools/profiler/core/GeckoSampler.h | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/tools/profiler/core/GeckoSampler.cpp b/tools/profiler/core/GeckoSampler.cpp index 25fed2f0b8a77..5ac559efeabaa 100644 --- a/tools/profiler/core/GeckoSampler.cpp +++ b/tools/profiler/core/GeckoSampler.cpp @@ -178,7 +178,6 @@ GeckoSampler::GeckoSampler(double aInterval, int aEntrySize, const char** aFeatures, uint32_t aFeatureCount, const char** aThreadNameFilters, uint32_t aFilterCount) : Sampler(aInterval, true, aEntrySize) - , mPrimaryThreadProfile(nullptr) , mBuffer(new ProfileBuffer(aEntrySize)) , mSaveRequested(false) #if defined(XP_WIN) diff --git a/tools/profiler/core/GeckoSampler.h b/tools/profiler/core/GeckoSampler.h index 532668eccd36a..13292464f874c 100644 --- a/tools/profiler/core/GeckoSampler.h +++ b/tools/profiler/core/GeckoSampler.h @@ -88,23 +88,6 @@ class GeckoSampler: public Sampler { virtual void HandleSaveRequest() override; virtual void DeleteExpiredMarkers() override; - ThreadProfile* GetPrimaryThreadProfile() - { - if (!mPrimaryThreadProfile) { - ::MutexAutoLock lock(*sRegisteredThreadsMutex); - - for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { - ThreadInfo* info = sRegisteredThreads->at(i); - if (info->IsMainThread() && !info->IsPendingDelete()) { - mPrimaryThreadProfile = info->Profile(); - break; - } - } - } - - return mPrimaryThreadProfile; - } - void ToStreamAsJSON(std::ostream& stream, double aSinceTime = 0); #ifndef SPS_STANDALONE virtual JSObject *ToJSObject(JSContext *aCx, double aSinceTime = 0); @@ -142,8 +125,6 @@ protected: void StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime); - // This represent the application's main thread (SAMPLER_INIT) - ThreadProfile* mPrimaryThreadProfile; RefPtr<ProfileBuffer> mBuffer; bool mSaveRequested; bool mAddLeafAddresses; -- GitLab