Bug 1429169 - Facilitate testing of cookie-related enterprise policy by always firing the cookie-db-read event
There seems to be no reason to conditionally fire the cookie-db-read event. Currently it is not fired if no cookies were read. There seems to be only one other consumer of this event (a test) which should work fine if the event were fired every time. This change would eliminate a particularly ugly workaround in cookie-related policy testing.
MozReview-Commit-ID: FbD1cvsBZBO
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -1480,17 +1480,17 @@ nsCookieService::InitDBConn()
}
}
mInitializedDBConn = true;
COOKIE_LOGSTRING(LogLevel::Debug, ("InitDBConn(): mInitializedDBConn = true"));
mEndInitDBConn = mozilla::TimeStamp::Now();
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
- if (os && !mReadArray.IsEmpty()) {
+ if (os) {
os->NotifyObservers(nullptr, "cookie-db-read", nullptr);
mReadArray.Clear();
}
}
nsresult
nsCookieService::InitDBConnInternal()
{