ResourceLoadStatistics.h [plain text]
#pragma once
#include "URL.h"
#include <wtf/HashCountedSet.h>
#include <wtf/HashSet.h>
#include <wtf/WallTime.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class KeyedDecoder;
class KeyedEncoder;
struct ResourceLoadStatistics {
explicit ResourceLoadStatistics(const String& primaryDomain)
: highLevelDomain(primaryDomain)
{
}
ResourceLoadStatistics() = default;
ResourceLoadStatistics(const ResourceLoadStatistics&) = delete;
ResourceLoadStatistics& operator=(const ResourceLoadStatistics&) = delete;
ResourceLoadStatistics(ResourceLoadStatistics&&) = default;
ResourceLoadStatistics& operator=(ResourceLoadStatistics&&) = default;
WEBCORE_EXPORT static String primaryDomain(const URL&);
WEBCORE_EXPORT static String primaryDomain(const String& host);
WEBCORE_EXPORT void encode(KeyedEncoder&) const;
WEBCORE_EXPORT bool decode(KeyedDecoder&);
String toString() const;
WEBCORE_EXPORT void merge(const ResourceLoadStatistics&);
String highLevelDomain;
WallTime lastSeen;
bool hadUserInteraction { false };
WallTime mostRecentUserInteractionTime { WallTime::fromRawSeconds(-1) };
bool grandfathered { false };
HashSet<String> storageAccessUnderTopFrameOrigins;
HashCountedSet<String> subframeUnderTopFrameOrigins;
HashCountedSet<String> subresourceUnderTopFrameOrigins;
HashCountedSet<String> subresourceUniqueRedirectsTo;
bool isPrevalentResource { false };
unsigned dataRecordsRemoved { 0 };
unsigned timesAccessedAsFirstPartyDueToUserInteraction { 0 };
unsigned timesAccessedAsFirstPartyDueToStorageAccessAPI { 0 };
bool isMarkedForCookiePartitioning { false };
bool isMarkedForCookieBlocking { false };
};
}