Bug 1016615 - Make subresources inherit timestamps from their parent. r=hurley

This commit is contained in:
Jeremy Poulin 2014-05-28 17:40:17 -07:00
parent 4e494d0b99
commit 7095d2917e

View File

@ -1381,7 +1381,7 @@ Seer::TryPredict(QueryType queryType, const TopLevelInfo &info, PRTime now,
nsAutoCString subresource; nsAutoCString subresource;
int baseConfidence, confidence; int baseConfidence, confidence;
// We use goto nextrow here instead of just failling, because we want // We use goto nextrow here instead of just failing, because we want
// to do some sort of prediction if at all possible. Of course, it's // to do some sort of prediction if at all possible. Of course, it's
// probably unlikely that subsequent rows will succeed if one fails, but // probably unlikely that subsequent rows will succeed if one fails, but
// it's worth a shot. // it's worth a shot.
@ -1987,19 +1987,17 @@ Seer::LearnForSubresource(const UriInfo &targetURI, const UriInfo &sourceURI)
hostInfo); hostInfo);
} }
PRTime now = PR_Now();
if (haveResource) { if (haveResource) {
UpdateSubresource(QUERY_PAGE, resourceInfo, now); UpdateSubresource(QUERY_PAGE, resourceInfo, pageInfo.lastLoad);
} else if (havePage) { } else if (havePage) {
AddSubresource(QUERY_PAGE, pageInfo.id, targetURI.spec, now); AddSubresource(QUERY_PAGE, pageInfo.id, targetURI.spec, pageInfo.lastLoad);
} }
// Can't add a subresource to a page we don't have in our db. // Can't add a subresource to a page we don't have in our db.
if (haveHost) { if (haveHost) {
UpdateSubresource(QUERY_ORIGIN, hostInfo, now); UpdateSubresource(QUERY_ORIGIN, hostInfo, originInfo.lastLoad);
} else if (haveOrigin) { } else if (haveOrigin) {
AddSubresource(QUERY_ORIGIN, originInfo.id, targetURI.origin, now); AddSubresource(QUERY_ORIGIN, originInfo.id, targetURI.origin, originInfo.lastLoad);
} }
// Can't add a subhost to a host we don't have in our db // Can't add a subhost to a host we don't have in our db
} }