From 93cae908bcbd063f21d5663a7d3149464af2ad20 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 4 Sep 2018 09:41:24 +0200 Subject: Remove all C++ telemetry autotimers --- toolkit/components/url-classifier/Classifier.cpp | 4 ---- toolkit/components/url-classifier/LookupCache.cpp | 2 -- .../url-classifier/VariableLengthPrefixSet.cpp | 13 ++++--------- .../url-classifier/nsUrlClassifierDBService.cpp | 2 -- .../url-classifier/nsUrlClassifierPrefixSet.cpp | 16 +++++----------- 5 files changed, 9 insertions(+), 28 deletions(-) (limited to 'toolkit/components/url-classifier') diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index e183728bd..b9d0ace1b 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -412,8 +412,6 @@ Classifier::Check(const nsACString& aSpec, uint32_t aFreshnessGuarantee, LookupResultArray& aResults) { - Telemetry::AutoTimer timer; - // Get the set of fragments based on the url. This is necessary because we // only look up at most 5 URLs per aSpec, even if aSpec has more than 5 // components. @@ -505,8 +503,6 @@ Classifier::Check(const nsACString& aSpec, nsresult Classifier::ApplyUpdates(nsTArray* aUpdates) { - Telemetry::AutoTimer timer; - PRIntervalTime clockStart = 0; if (LOG_ENABLED()) { clockStart = PR_IntervalNow(); diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index 420e07433..7c4d7682b 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -541,8 +541,6 @@ static void EnsureSorted(T* aArray) nsresult LookupCacheV2::ConstructPrefixSet(AddPrefixArray& aAddPrefixes) { - Telemetry::AutoTimer timer; - nsTArray array; if (!array.SetCapacity(aAddPrefixes.Length(), fallible)) { return NS_ERROR_OUT_OF_MEMORY; diff --git a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp index e9d6770d3..a387a698c 100644 --- a/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp +++ b/toolkit/components/url-classifier/VariableLengthPrefixSet.cpp @@ -209,8 +209,6 @@ VariableLengthPrefixSet::LoadFromFile(nsIFile* aFile) NS_ENSURE_ARG_POINTER(aFile); - Telemetry::AutoTimer timer; - nsCOMPtr localInFile; nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, PR_RDONLY | nsIFile::OS_READAHEAD); @@ -255,15 +253,12 @@ VariableLengthPrefixSet::StoreToFile(nsIFile* aFile) uint32_t fileSize = 0; // Preallocate the file storage - { - nsCOMPtr fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer timer; + nsCOMPtr fos(do_QueryInterface(localOutFile)); - fileSize += mFixedPrefixSet->CalculatePreallocateSize(); - fileSize += CalculatePreallocateSize(); + fileSize += mFixedPrefixSet->CalculatePreallocateSize(); + fileSize += CalculatePreallocateSize(); - Unused << fos->Preallocate(fileSize); - } + Unused << fos->Preallocate(fileSize); // Convert to buffered stream nsCOMPtr out = diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 3cf24847e..d3018aa2d 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -1814,8 +1814,6 @@ nsUrlClassifierDBService::Shutdown() gShuttingDownThread = true; - Telemetry::AutoTimer timer; - mCompleters.Clear(); nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp index 874565470..3cfdf7a35 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp @@ -315,8 +315,6 @@ nsUrlClassifierPrefixSet::LoadFromFile(nsIFile* aFile) { MutexAutoLock lock(mLock); - Telemetry::AutoTimer timer; - nsCOMPtr localInFile; nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(localInFile), aFile, PR_RDONLY | nsIFile::OS_READAHEAD); @@ -356,17 +354,13 @@ nsUrlClassifierPrefixSet::StoreToFile(nsIFile* aFile) uint32_t fileSize; - // Preallocate the file storage - { - nsCOMPtr fos(do_QueryInterface(localOutFile)); - Telemetry::AutoTimer timer; + nsCOMPtr fos(do_QueryInterface(localOutFile)); - fileSize = CalculatePreallocateSize(); + fileSize = CalculatePreallocateSize(); - // Ignore failure, the preallocation is a hint and we write out the entire - // file later on - Unused << fos->Preallocate(fileSize); - } + // Ignore failure, the preallocation is a hint and we write out the entire + // file later on + Unused << fos->Preallocate(fileSize); // Convert to buffered stream nsCOMPtr out = -- cgit v1.2.3