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 --- netwerk/cache/nsCacheService.cpp | 4 ---- netwerk/cache/nsDeleteDir.cpp | 3 --- netwerk/cache/nsDiskCacheDevice.cpp | 2 -- netwerk/cache/nsDiskCacheDeviceSQL.cpp | 1 - netwerk/cache/nsMemoryCacheDevice.cpp | 1 - netwerk/cache2/CacheFileIOManager.cpp | 3 --- netwerk/cookie/nsCookieService.cpp | 21 ++++++++------------- 7 files changed, 8 insertions(+), 27 deletions(-) (limited to 'netwerk') diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index 7c977c09d..97b1a71c8 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -1184,7 +1184,6 @@ nsCacheService::Shutdown() } nsCOMPtr cacheIOThread; - Telemetry::AutoTimer totalTimer; bool shouldSanitize = false; nsCOMPtr parentDir; @@ -1261,10 +1260,8 @@ nsCacheService::Shutdown() if (NS_SUCCEEDED(parentDir->Exists(&exists)) && exists) nsDeleteDir::DeleteDir(parentDir, false); } - Telemetry::AutoTimer timer; nsDeleteDir::Shutdown(shouldSanitize); } else { - Telemetry::AutoTimer timer; nsDeleteDir::Shutdown(shouldSanitize); } } @@ -2175,7 +2172,6 @@ nsCacheService::ActivateEntry(nsCacheRequest * request, nsCacheEntry * nsCacheService::SearchCacheDevices(nsCString * key, nsCacheStoragePolicy policy, bool *collision) { - Telemetry::AutoTimer timer; nsCacheEntry * entry = nullptr; CACHE_LOG_DEBUG(("mMemoryDevice: 0x%p\n", mMemoryDevice)); diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp index 1f3f3934e..8c4edf812 100644 --- a/netwerk/cache/nsDeleteDir.cpp +++ b/netwerk/cache/nsDeleteDir.cpp @@ -155,7 +155,6 @@ nsDeleteDir::DestroyThread() void nsDeleteDir::TimerCallback(nsITimer *aTimer, void *arg) { - Telemetry::AutoTimer timer; { MutexAutoLock lock(gInstance->mLock); @@ -193,8 +192,6 @@ nsDeleteDir::TimerCallback(nsITimer *aTimer, void *arg) nsresult nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, uint32_t delay) { - Telemetry::AutoTimer timer; - if (!gInstance) return NS_ERROR_NOT_INITIALIZED; diff --git a/netwerk/cache/nsDiskCacheDevice.cpp b/netwerk/cache/nsDiskCacheDevice.cpp index ac91534ff..09089bfb6 100644 --- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -457,7 +457,6 @@ nsDiskCacheDevice::GetDeviceID() nsCacheEntry * nsDiskCacheDevice::FindEntry(nsCString * key, bool *collision) { - Telemetry::AutoTimer timer; if (!Initialized()) return nullptr; // NS_ERROR_NOT_INITIALIZED if (mClearingDiskCache) return nullptr; nsDiskCacheRecord record; @@ -955,7 +954,6 @@ nsDiskCacheDevice::EvictEntries(const char * clientID) nsresult nsDiskCacheDevice::OpenDiskCache() { - Telemetry::AutoTimer timer; // if we don't have a cache directory, create one and open it bool exists; nsresult rv = mCacheDirectory->Exists(&exists); diff --git a/netwerk/cache/nsDiskCacheDeviceSQL.cpp b/netwerk/cache/nsDiskCacheDeviceSQL.cpp index 56ece5887..f4b1d72c9 100644 --- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp +++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp @@ -1523,7 +1523,6 @@ nsOfflineCacheDevice::FindEntry(nsCString *fullKey, bool *collision) { NS_ENSURE_TRUE(Initialized(), nullptr); - mozilla::Telemetry::AutoTimer timer; LOG(("nsOfflineCacheDevice::FindEntry [key=%s]\n", fullKey->get())); // SELECT * FROM moz_cache WHERE key = ? diff --git a/netwerk/cache/nsMemoryCacheDevice.cpp b/netwerk/cache/nsMemoryCacheDevice.cpp index 042e86022..eb69e8ea8 100644 --- a/netwerk/cache/nsMemoryCacheDevice.cpp +++ b/netwerk/cache/nsMemoryCacheDevice.cpp @@ -113,7 +113,6 @@ nsMemoryCacheDevice::GetDeviceID() nsCacheEntry * nsMemoryCacheDevice::FindEntry(nsCString * key, bool *collision) { - mozilla::Telemetry::AutoTimer timer; nsCacheEntry * entry = mMemCacheEntries.GetEntry(key); if (!entry) return nullptr; diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 98fdc24ac..f6b499e47 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -1172,8 +1172,6 @@ CacheFileIOManager::Shutdown() return NS_ERROR_NOT_INITIALIZED; } - Telemetry::AutoTimer shutdownTimer; - CacheIndex::PreShutdown(); ShutdownMetadataWriteScheduling(); @@ -1191,7 +1189,6 @@ CacheFileIOManager::Shutdown() CacheIndex::Shutdown(); if (CacheObserver::ClearCacheOnShutdown()) { - Telemetry::AutoTimer totalTimer; gInstance->SyncRemoveAllCacheFiles(); } diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 52558107b..ea54dbd61 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -954,19 +954,14 @@ nsCookieService::TryInitDB(bool aRecreateDB) NS_ENSURE_SUCCESS(rv, RESULT_FAILURE); } - // This block provides scope for the Telemetry AutoTimer - { - Telemetry::AutoTimer - telemetry; - ReadAheadFile(mDefaultDBState->cookieFile); - - // open a connection to the cookie database, and only cache our connection - // and statements upon success. The connection is opened unshared to eliminate - // cache contention between the main and background threads. - rv = mStorageService->OpenUnsharedDatabase(mDefaultDBState->cookieFile, - getter_AddRefs(mDefaultDBState->dbConn)); - NS_ENSURE_SUCCESS(rv, RESULT_RETRY); - } + ReadAheadFile(mDefaultDBState->cookieFile); + + // open a connection to the cookie database, and only cache our connection + // and statements upon success. The connection is opened unshared to eliminate + // cache contention between the main and background threads. + rv = mStorageService->OpenUnsharedDatabase(mDefaultDBState->cookieFile, + getter_AddRefs(mDefaultDBState->dbConn)); + NS_ENSURE_SUCCESS(rv, RESULT_RETRY); // Set up our listeners. mDefaultDBState->insertListener = new InsertCookieDBListener(mDefaultDBState); -- cgit v1.2.3