Bug 1091297 - http age calculation wrongly assumed monotonic time. r=hurley

This commit is contained in:
Patrick McManus 2014-10-31 15:45:08 -04:00
Родитель ae83260be8
Коммит 6a0b4d6eed
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -372,6 +372,11 @@ nsHttpResponseHead::ComputeCurrentAge(uint32_t now,
*result = 0;
if (requestTime > now) {
// for calculation purposes lets not allow the request to happen in the future
requestTime = now;
}
if (NS_FAILED(GetDateValue(&dateValue))) {
LOG(("nsHttpResponseHead::ComputeCurrentAge [this=%p] "
"Date response header not set!\n", this));
@ -388,8 +393,6 @@ nsHttpResponseHead::ComputeCurrentAge(uint32_t now,
if (NS_SUCCEEDED(GetAgeValue(&ageValue)))
*result = std::max(*result, ageValue);
MOZ_ASSERT(now >= requestTime, "bogus request time");
// Compute current age
*result += (now - requestTime);
return NS_OK;