Bug 633747 - about:cache now displays 'Expired Immediately' for 1970-01-01 01:00:00 r=mayhemer

MozReview-Commit-ID: 89CX7UqwuXl

--HG--
extra : rebase_source : b8d9a8fba8ff017b5633c093c57127076c77757a
This commit is contained in:
Amar Lakshya 2017-05-02 20:48:34 +05:30
Родитель badcf950f5
Коммит 077409e068
2 изменённых файлов: 4 добавлений и 14 удалений

Просмотреть файл

@ -493,13 +493,8 @@ nsAboutCache::Channel::OnCacheEntryInfo(nsIURI *aURI, const nsACString & aIdEnha
mBuffer.AppendLiteral(" <td>");
// Bug - 633747.
// It says in the bug that the odd expiration time is: 1970-01-01 01:00:00
// However, that time is in local time(Africa in the bug).
// variable 'mExpirationTime' gets the conversion:
// 1970-01-01 01:00:00 --> 1970-01-01 00:00:00 GMT which is 0 in hex
// So, 0 represents the UNIX timestamp 1970-01-01 00:00:00 GMT.
// We just find out if the expiration time is equal
// to 0 and if so, we simply show "expired immediately"
// When expiration time is 0, we show 1970-01-01 01:00:00 which is confusing.
// So we check if time is 0, then we show a message, "Expired Immediately"
if (aExpirationTime == 0) {
mBuffer.AppendLiteral("Expired Immediately");
} else if (aExpirationTime < 0xFFFFFFFF) {

Просмотреть файл

@ -429,13 +429,8 @@ nsAboutCacheEntry::Channel::WriteCacheEntryDescription(nsICacheEntry *entry)
entry->GetExpirationTime(&u);
// Bug - 633747.
// It says in the bug that the odd expiration time is: 1970-01-01 01:00:00
// However, that time is in local time(Africa in the bug).
// variable 'u' gets the conversion:
// 1970-01-01 01:00:00 --> 1970-01-01 00:00:00 GMT which is 0 in hex
// So, 0 represents the UNIX timestamp 1970-01-01 00:00:00 GMT.
// We just find out if the expiration time is equal
// to 0 and if so, we simply show "expired immediately"
// When expiration time is 0, we show 1970-01-01 01:00:00 which is confusing.
// So we check if time is 0, then we show a message, "Expired Immediately"
if (u == 0) {
APPEND_ROW("expires", "Expired Immediately");
} else if (u < 0xFFFFFFFF) {