Bug 633747 - about:cache now displays 'Expired Immediately' for 1970-01-01 01:00:00 r=mayhemer
authorAmar Lakshya <amar.lakshya@xaviers.edu.in>
Tue, 02 May 2017 20:48:34 +0530
changeset 357069 f13ecab9206eec7e8cf806e4be39124ff59451f2
parent 357068 8155ff5b98d80b9f3117de679af2d0da75fac628
child 357070 3655533be7c7a54ee2f9b98d247a7af2cac1321a
push id31781
push userkwierso@gmail.com
push dateMon, 08 May 2017 20:44:15 +0000
treeherdermozilla-central@e0955584782e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs633747
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 633747 - about:cache now displays 'Expired Immediately' for 1970-01-01 01:00:00 r=mayhemer MozReview-Commit-ID: 89CX7UqwuXl
netwerk/protocol/about/nsAboutCache.cpp
netwerk/protocol/about/nsAboutCacheEntry.cpp
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -488,23 +488,18 @@ nsAboutCache::Channel::OnCacheEntryInfo(
         mBuffer.AppendLiteral("No last modified time");
     }
     mBuffer.AppendLiteral("</td>\n");
 
     // Expires time
     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) {
         PrintTimeString(buf, sizeof(buf), aExpirationTime);
         mBuffer.Append(buf);
     } else {
         mBuffer.AppendLiteral("No expiration time");
     }
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -424,23 +424,18 @@ nsAboutCacheEntry::Channel::WriteCacheEn
     } else {
         APPEND_ROW("last modified", "No last modified time (bug 1000338)");
     }
 
     // Expiration Time
     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) {
         PrintTimeString(timeBuf, sizeof(timeBuf), u);
         APPEND_ROW("expires", timeBuf);
     } else {
         APPEND_ROW("expires", "No expiration time");
     }