diff options
Diffstat (limited to 'netwerk/cookie/nsCookieService.cpp')
-rw-r--r-- | netwerk/cookie/nsCookieService.cpp | 51 |
1 files changed, 9 insertions, 42 deletions
diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 1c4e5e7409..ea54dbd611 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::MOZ_SQLITE_COOKIES_OPEN_READAHEAD_MS> - 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); @@ -3325,11 +3320,6 @@ nsCookieService::SetCookieInternal(nsIURI *aHostURI, // 3 = secure and "https:" bool isHTTPS; nsresult rv = aHostURI->SchemeIs("https", &isHTTPS); - if (NS_SUCCEEDED(rv)) { - Telemetry::Accumulate(Telemetry::COOKIE_SCHEME_SECURITY, - ((cookieAttributes.isSecure)? 0x02 : 0x00) | - ((isHTTPS)? 0x01 : 0x00)); - } int64_t currentTimeInUsec = PR_Now(); @@ -3480,8 +3470,6 @@ nsCookieService::AddInternal(const nsCookieKey &aKey, if (mLeaveSecureAlone && aCookie->IsSecure() && !isSecure) { COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "non-https cookie can't set secure flag"); - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - BLOCKED_SECURE_SET_FROM_HTTP); return; } nsListIter exactIter; @@ -3502,14 +3490,7 @@ nsCookieService::AddInternal(const nsCookieKey &aKey, if (!isSecure) { COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader, "cookie can't save because older cookie is secure cookie but newer cookie is non-secure cookie"); - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - BLOCKED_DOWNGRADE_SECURE); return; - } else { - // A secure site is allowed to downgrade a secure cookie - // but we want to measure anyway - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - DOWNGRADE_SECURE_FROM_SECURE); } } } @@ -3609,8 +3590,6 @@ nsCookieService::AddInternal(const nsCookieKey &aKey, // It's valid to evict a secure cookie for another secure cookie. oldestCookieTime = FindStaleCookie(entry, currentTime, aHostURI, Some(true), iter); } else { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTING_SECURE_BLOCKED); COOKIE_LOGEVICTED(aCookie, "Too many cookies for this domain and the new cookie is not a secure cookie"); return; @@ -4651,19 +4630,7 @@ void nsCookieService::TelemetryForEvictingStaleCookie(nsCookie *aEvicted, int64_t oldestCookieTime) { - // We need to record the evicting cookie to telemetry. - if (!aEvicted->IsSecure()) { - if (aEvicted->LastAccessed() > oldestCookieTime) { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTED_NEWER_INSECURE); - } else { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTED_OLDEST_COOKIE); - } - } else { - Telemetry::Accumulate(Telemetry::COOKIE_LEAVE_SECURE_ALONE, - EVICTED_PREFERRED_COOKIE); - } + /* STUB */ } // count the number of cookies stored by a particular host. this is provided by the |