Modified: trunk/Source/WebKit/ChangeLog (270204 => 270205)
--- trunk/Source/WebKit/ChangeLog 2020-11-27 20:34:50 UTC (rev 270204)
+++ trunk/Source/WebKit/ChangeLog 2020-11-27 20:36:55 UTC (rev 270205)
@@ -1,3 +1,36 @@
+2020-11-27 Don Olmstead <[email protected]>
+
+ Fix build when ENABLE_RESOURCE_LOAD_STATISTICS is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=219316
+
+ Unreviewed build fix.
+
+ Add ENABLE(RESOURCE_LOAD_STATISTICS) guards around NetworkSession requests for
+ resource load statistics. Move firePrivateClickMeasurementTimerImmediately out of
+ a ENABLE(RESOURCE_LOAD_STATISTICS) guard and place it where its ordered in the header.
+
+ This originally broke the PlayStation build before ENABLE_RESOURCE_LOAD_STATISTICS
+ was turned on.
+
+ No new tests. No change in behavior.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::simulateResourceLoadStatisticsSessionRestart):
+ * NetworkProcess/NetworkSession.cpp:
+ (WebKit::NetworkSession::firePrivateClickMeasurementTimerImmediately):
+ * NetworkProcess/PrivateClickMeasurementManager.cpp:
+ (WebKit::PrivateClickMeasurementManager::storeUnattributed):
+ (WebKit::PrivateClickMeasurementManager::attribute):
+ (WebKit::PrivateClickMeasurementManager::clearSentAttributions):
+ (WebKit::PrivateClickMeasurementManager::updateTimerLastFired):
+ (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
+ (WebKit::PrivateClickMeasurementManager::clear):
+ (WebKit::PrivateClickMeasurementManager::clearForRegistrableDomain):
+ (WebKit::PrivateClickMeasurementManager::clearExpired):
+ (WebKit::PrivateClickMeasurementManager::toString const):
+ (WebKit::PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting):
+ (WebKit::PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
+
2020-11-27 Wenson Hsieh <[email protected]>
Introduce new display list meta commands in preparation for webkit.org/b/219091
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (270204 => 270205)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2020-11-27 20:34:50 UTC (rev 270204)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2020-11-27 20:36:55 UTC (rev 270205)
@@ -2570,6 +2570,7 @@
void NetworkProcess::simulateResourceLoadStatisticsSessionRestart(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler)
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* session = networkSession(sessionID)) {
session->recreateResourceLoadStatisticStore([this, sessionID, completionHandler = WTFMove(completionHandler)] () mutable {
firePrivateClickMeasurementTimerImmediately(sessionID);
@@ -2577,6 +2578,7 @@
});
return;
}
+#endif
completionHandler();
}
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp (270204 => 270205)
--- trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp 2020-11-27 20:34:50 UTC (rev 270204)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp 2020-11-27 20:36:55 UTC (rev 270205)
@@ -188,11 +188,6 @@
forwardResourceLoadStatisticsSettings();
}
-void NetworkSession::firePrivateClickMeasurementTimerImmediately()
-{
- m_privateClickMeasurement->startTimer(0_s);
-}
-
void NetworkSession::recreateResourceLoadStatisticStore(CompletionHandler<void()>&& completionHandler)
{
destroyResourceLoadStatistics([this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)] () mutable {
@@ -353,6 +348,11 @@
m_privateClickMeasurement->markAllUnattributedAsExpiredForTesting();
}
+void NetworkSession::firePrivateClickMeasurementTimerImmediately()
+{
+ m_privateClickMeasurement->startTimer(0_s);
+}
+
void NetworkSession::addKeptAliveLoad(Ref<NetworkResourceLoader>&& loader)
{
ASSERT(m_sessionID == loader->sessionID());
Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (270204 => 270205)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp 2020-11-27 20:34:50 UTC (rev 270204)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp 2020-11-27 20:36:55 UTC (rev 270205)
@@ -74,8 +74,10 @@
m_networkProcess->broadcastConsoleMessage(m_sessionID, MessageSource::PrivateClickMeasurement, MessageLevel::Error, "[Private Click Measurement] Storing an ad click."_s);
}
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->insertPrivateClickMeasurement(WTFMove(attribution), PrivateClickMeasurementAttributionType::Unattributed);
+#endif
}
void PrivateClickMeasurementManager::handleAttribution(AttributionTriggerData&& attributionTriggerData, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest)
@@ -112,6 +114,7 @@
void PrivateClickMeasurementManager::attribute(const SourceSite& sourceSite, const AttributeOnSite& attributeOnSite, AttributionTriggerData&& attributionTriggerData)
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
resourceLoadStatistics->attributePrivateClickMeasurement(sourceSite, attributeOnSite, WTFMove(attributionTriggerData), [this] (auto optionalSecondsUntilSend) {
if (optionalSecondsUntilSend) {
@@ -128,6 +131,7 @@
}
});
}
+#endif
}
void PrivateClickMeasurementManager::fireConversionRequest(const PrivateClickMeasurement& attribution)
@@ -183,18 +187,23 @@
void PrivateClickMeasurementManager::clearSentAttributions(Vector<PrivateClickMeasurement>&& sentConversions)
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->clearSentAttributions(WTFMove(sentConversions));
+#endif
}
void PrivateClickMeasurementManager::updateTimerLastFired()
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->updateTimerLastFired();
+#endif
}
void PrivateClickMeasurementManager::firePendingAttributionRequests()
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics();
if (!resourceLoadStatistics)
return;
@@ -227,6 +236,7 @@
if (nextTimeToFire < Seconds::infinity())
startTimer(nextTimeToFire);
});
+#endif
}
void PrivateClickMeasurementManager::clear()
@@ -233,26 +243,34 @@
{
m_firePendingAttributionRequestsTimer.stop();
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->clearPrivateClickMeasurement();
+#endif
}
void PrivateClickMeasurementManager::clearForRegistrableDomain(const RegistrableDomain& domain)
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->clearPrivateClickMeasurementForRegistrableDomain(domain);
+#endif
}
void PrivateClickMeasurementManager::clearExpired()
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->clearExpiredPrivateClickMeasurement();
+#endif
}
void PrivateClickMeasurementManager::toString(CompletionHandler<void(String)>&& completionHandler) const
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->privateClickMeasurementToString(WTFMove(completionHandler));
+#endif
}
void PrivateClickMeasurementManager::setConversionURLForTesting(URL&& testURL)
@@ -265,8 +283,10 @@
void PrivateClickMeasurementManager::markAllUnattributedAsExpiredForTesting()
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics())
resourceLoadStatistics->markAllUnattributedPrivateClickMeasurementAsExpiredForTesting();
+#endif
}
bool PrivateClickMeasurementManager::debugModeEnabled() const
@@ -276,10 +296,12 @@
void PrivateClickMeasurementManager::markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&& completionHandler)
{
+#if ENABLE(RESOURCE_LOAD_STATISTICS)
if (auto* resourceLoadStatistics = m_networkSession->resourceLoadStatistics()) {
resourceLoadStatistics->markAttributedPrivateClickMeasurementsAsExpiredForTesting(WTFMove(completionHandler));
return;
}
+#endif
completionHandler();
}