Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp (284050 => 284051)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp 2021-10-12 22:47:34 UTC (rev 284050)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp 2021-10-12 22:48:22 UTC (rev 284051)
@@ -54,7 +54,7 @@
constexpr Seconds debugModeSecondsUntilSend { 10_s };
PrivateClickMeasurementManager::PrivateClickMeasurementManager(UniqueRef<PCM::Client>&& client, const String& storageDirectory)
- : m_firePendingAttributionRequestsTimer(*this, &PrivateClickMeasurementManager::firePendingAttributionRequests)
+ : m_firePendingAttributionRequestsTimer(RunLoop::main(), this, &PrivateClickMeasurementManager::firePendingAttributionRequests)
, m_storageDirectory(storageDirectory)
, m_client(WTFMove(client))
{
@@ -136,12 +136,12 @@
RELEASE_LOG_INFO(PrivateClickMeasurement, "About to fire a token public key request.");
m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] About to fire a token public key request."_s);
- PCM::NetworkLoader::start(WTFMove(tokenPublicKeyURL), nullptr, pcmDataCarried, [weakThis = WeakPtr { *this }, this, attribution = WTFMove(attribution), callback = WTFMove(callback)] (auto& error, auto& response, auto& jsonObject) mutable {
+ PCM::NetworkLoader::start(WTFMove(tokenPublicKeyURL), nullptr, pcmDataCarried, [weakThis = WeakPtr { *this }, this, attribution = WTFMove(attribution), callback = WTFMove(callback)] (auto& errorDescription, auto& jsonObject) mutable {
if (!weakThis)
return;
- if (!error.isNull()) {
- m_client->broadcastConsoleMessage(MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, error.localizedDescription(), "' for token public key request."_s));
+ if (!errorDescription.isNull()) {
+ m_client->broadcastConsoleMessage(MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, errorDescription, "' for token public key request."_s));
return;
}
@@ -179,12 +179,12 @@
RELEASE_LOG_INFO(PrivateClickMeasurement, "About to fire a unlinkable token signing request.");
m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] About to fire a unlinkable token signing request."_s);
- PCM::NetworkLoader::start(WTFMove(tokenSignatureURL), measurement.tokenSignatureJSON(), pcmDataCarried, [weakThis = WeakPtr { *this }, this, measurement = WTFMove(measurement)] (auto& error, auto& response, auto& jsonObject) mutable {
+ PCM::NetworkLoader::start(WTFMove(tokenSignatureURL), measurement.tokenSignatureJSON(), pcmDataCarried, [weakThis = WeakPtr { *this }, this, measurement = WTFMove(measurement)] (auto& errorDescription, auto& jsonObject) mutable {
if (!weakThis)
return;
- if (!error.isNull()) {
- m_client->broadcastConsoleMessage(MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, error.localizedDescription(), "' for secret token signing request."_s));
+ if (!errorDescription.isNull()) {
+ m_client->broadcastConsoleMessage(MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, errorDescription, "' for secret token signing request."_s));
return;
}
@@ -300,7 +300,7 @@
if (!minSecondsUntilSend)
return;
- if (m_firePendingAttributionRequestsTimer.isActive() && m_firePendingAttributionRequestsTimer.nextFireInterval() < *minSecondsUntilSend)
+ if (m_firePendingAttributionRequestsTimer.isActive() && m_firePendingAttributionRequestsTimer.secondsUntilFire() < *minSecondsUntilSend)
return;
if (UNLIKELY(debugModeEnabled())) {
@@ -365,12 +365,12 @@
RELEASE_LOG_INFO(PrivateClickMeasurement, "About to fire an attribution request.");
m_client->broadcastConsoleMessage(MessageLevel::Log, "[Private Click Measurement] About to fire an attribution request."_s);
- PCM::NetworkLoader::start(WTFMove(attributionURL), attribution.attributionReportJSON(), pcmDataCarried, [weakThis = WeakPtr { *this }, this](auto& error, auto& response, auto&) {
+ PCM::NetworkLoader::start(WTFMove(attributionURL), attribution.attributionReportJSON(), pcmDataCarried, [weakThis = WeakPtr { *this }, this](auto& errorDescription, auto&) {
if (!weakThis)
return;
- if (!error.isNull())
- m_client->broadcastConsoleMessage(MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, error.localizedDescription(), "' for ad click attribution request."_s));
+ if (!errorDescription.isNull())
+ m_client->broadcastConsoleMessage(MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, errorDescription, "' for ad click attribution request."_s));
});
}
Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.cpp (284050 => 284051)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.cpp 2021-10-12 22:47:34 UTC (rev 284050)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.cpp 2021-10-12 22:48:22 UTC (rev 284051)
@@ -38,7 +38,7 @@
void NetworkLoader::start(URL&&, RefPtr<JSON::Object>&&, WebCore::PrivateClickMeasurement::PcmDataCarried, Callback&& completionHandler)
{
notImplemented();
- completionHandler({ }, { }, { });
+ completionHandler({ }, { });
}
void NetworkLoader::allowTLSCertificateChainForLocalPCMTesting(const WebCore::CertificateInfo&)
Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.h (284050 => 284051)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.h 2021-10-12 22:47:34 UTC (rev 284050)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.h 2021-10-12 22:48:22 UTC (rev 284051)
@@ -42,7 +42,7 @@
class NetworkLoader {
WTF_MAKE_FAST_ALLOCATED;
public:
- using Callback = CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&, const RefPtr<JSON::Object>&)>;
+ using Callback = CompletionHandler<void(const String&, const RefPtr<JSON::Object>&)>;
static void start(URL&&, RefPtr<JSON::Object>&&, WebCore::PrivateClickMeasurement::PcmDataCarried, Callback&&);
static void allowTLSCertificateChainForLocalPCMTesting(const WebCore::CertificateInfo&);
};
Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementNetworkLoaderCocoa.mm (284050 => 284051)
--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementNetworkLoaderCocoa.mm 2021-10-12 22:47:34 UTC (rev 284050)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementNetworkLoaderCocoa.mm 2021-10-12 22:48:22 UTC (rev 284051)
@@ -112,7 +112,7 @@
// Prevent contacting non-local servers when a test certificate chain is used for 127.0.0.1.
// FIXME: Use a proxy server to have tests cover the reports sent to the destination, too.
if (allowedLocalTestServerTrust() && url.host() != "127.0.0.1")
- return callback({ }, { }, { });
+ return callback({ }, { });
auto request = adoptNS([[NSMutableURLRequest alloc] initWithURL:url]);
[request setValue:WebCore::HTTPHeaderValues::maxAge0() forHTTPHeaderField:@"Cache-Control"];
@@ -129,10 +129,10 @@
NSURLSessionDataTask *task = [statelessSessionWithoutRedirects() dataTaskWithRequest:request.get() completionHandler:makeBlockPtr([callback = WTFMove(callback), identifier](NSData *data, NSURLResponse *response, NSError *error) mutable {
taskMap().remove(identifier);
if (error)
- return callback(error, { }, { });
+ return callback(error.localizedDescription, { });
if (auto jsonValue = JSON::Value::parseJSON(String::fromUTF8(static_cast<const LChar*>(data.bytes), data.length)))
- return callback({ }, response, jsonValue->asObject());
- callback({ }, response, nullptr);
+ return callback({ }, jsonValue->asObject());
+ callback({ }, nullptr);
}).get()];
[task resume];
taskMap().add(identifier, task);