Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFrom...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Feb 2018 00:52:29 +0000 (00:52 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Feb 2018 00:52:29 +0000 (00:52 +0000)
commitbfc728e48c0c024e5aaec7bce8a8319281b5f9a5
tree709aef2819180402684885e9ef09357b865ab3cc
parent05d246b5cf2224bdece43df666e0a678b47839aa
Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
https://bugs.webkit.org/show_bug.cgi?id=182812
<rdar://problem/37511406>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. Tested manually between versions of Safari.

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
    Now only expects these fields for model version 11 or higher:
    - topFrameUniqueRedirectsTo
    - topFrameUniqueRedirectsFrom
    - subresourceUniqueRedirectsFrom
    - timesAccessedAsFirstPartyDueToUserInteraction
    - timesAccessedAsFirstPartyDueToStorageAccessAPI
* loader/ResourceLoadStatistics.h:

Source/WebKit:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
    Now does the following:
    - Logs when there is a model version mismatch.
    - Does not ingest statistics if the version on disk is newer than the supported one.
    - Does ingest statistics if the version on disk is older than the supported one.
    - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadStatistics.cpp
Source/WebCore/loader/ResourceLoadStatistics.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp