Changeset 273133 in webkit
- Timestamp:
- Feb 19, 2021 1:10:16 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273132 r273133 1 2021-02-19 Jiewen Tan <jiewen_tan@apple.com> 2 3 PCM: Request server public key to generate secret token 4 https://bugs.webkit.org/show_bug.cgi?id=222141 5 <rdar://problem/74462955> 6 7 Reviewed by John Wilander. 8 9 * http/tests/privateClickMeasurement/resources/getTokenSigningData.php: 10 * http/tests/privateClickMeasurement/resources/signToken.php: 11 * http/tests/privateClickMeasurement/resources/util.js: 12 (tearDownAndFinish): 13 * http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt: 14 * http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html: 15 This patch modifies the above tests to be able to record two consecutive server requests. 16 1 17 2021-02-19 Imanol Fernandez <ifernandez@igalia.com> and Sergio Villar Senin <svillar@igalia.com> 2 18 -
trunk/LayoutTests/http/tests/privateClickMeasurement/resources/getTokenSigningData.php
r273088 r273133 45 45 echo "if (window.testRunner) {"; 46 46 echo " testRunner.setPrivateClickMeasurementOverrideTimerForTesting(false);"; 47 echo " testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting('');"; 47 48 echo " testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting('');"; 48 49 echo " testRunner.notifyDone();"; -
trunk/LayoutTests/http/tests/privateClickMeasurement/resources/signToken.php
r273088 r273133 2 2 require_once "tokenSigningFilePath.php"; 3 3 4 $tokenSigningFile = fopen($tokenSigningFilePath . ".tmp", ' w');4 $tokenSigningFile = fopen($tokenSigningFilePath . ".tmp", 'a'); 5 5 $httpHeaders = $_SERVER; 6 6 $cookiesFound = false; 7 // This php will respond to two consecutive server requests. 8 // It will only complete the transaction when the second request finishes. 9 $isSecondRequest = false; 10 11 if ($value = $httpHeaders["REQUEST_METHOD"]) { 12 fwrite($tokenSigningFile, "REQUEST_METHOD: $value\n"); 13 } 7 14 8 15 if ($value = $httpHeaders["HTTP_HOST"]) { … … 27 34 $outputURL = substr($value, 0, $positionOfDummy); 28 35 fwrite($tokenSigningFile, "REQUEST_URI: $outputURL\n"); 36 37 $positionOfDummy = strpos($value, "&second="); 38 if ($positionOfDummy != false) 39 $isSecondRequest = true; 29 40 } 30 41 … … 37 48 38 49 fclose($tokenSigningFile); 39 rename($tokenSigningFilePath . ".tmp", $tokenSigningFilePath); 50 // Complete the transaction. 51 if ($isSecondRequest) 52 rename($tokenSigningFilePath . ".tmp", $tokenSigningFilePath); 40 53 41 54 header("HTTP/1.1 201 Created"); -
trunk/LayoutTests/http/tests/privateClickMeasurement/resources/util.js
r273088 r273133 14 14 testRunner.setPrivateClickMeasurementAttributionReportURLForTesting(""); 15 15 testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting(""); 16 testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting(""); 16 17 testRunner.notifyDone(); 17 18 } -
trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce-expected.txt
r273088 r273133 7 7 -------- 8 8 Token signing request received. 9 REQUEST_METHOD: GET 10 HTTP_HOST: 127.0.0.1:8000 11 REQUEST_URI: /privateClickMeasurement/resources/signToken.php 12 No cookies in token signing request. 13 Request body: 14 15 REQUEST_METHOD: POST 9 16 HTTP_HOST: 127.0.0.1:8000 10 17 Content type: application/json -
trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html
r273088 r273133 51 51 const highEntropyBits = currentTimeMillis - (Math.floor(currentTimeMillis / 1000000) * 1000000); 52 52 const dummy = highEntropyBits + "" + Math.floor(Math.random() * 100); 53 testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/signToken.php?dummy=" + dummy); 53 testRunner.setPrivateClickMeasurementTokenPublicKeyURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/signToken.php?dummy=" + dummy); 54 testRunner.setPrivateClickMeasurementTokenSignatureURLForTesting("http://127.0.0.1:8000/privateClickMeasurement/resources/signToken.php?dummy=" + dummy + "&second=true"); 54 55 targetLink.href = "http://localhost:8000/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html?dummy=" + dummy; 55 56 activateElement("targetLink"); -
trunk/Source/WebCore/ChangeLog
r273132 r273133 1 2021-02-19 Jiewen Tan <jiewen_tan@apple.com> 2 3 PCM: Request server public key to generate secret token 4 https://bugs.webkit.org/show_bug.cgi?id=222141 5 <rdar://problem/74462955> 6 7 Reviewed by John Wilander. 8 9 This patch adds a way for PCM fraud prevention to request the server public key 10 which will be then used to generate the unlinkable token. 11 12 Covered by existing tests. 13 14 * loader/PrivateClickMeasurement.cpp: 15 (WebCore::PrivateClickMeasurement::tokenPublicKeyURL const): 16 * loader/PrivateClickMeasurement.h: 17 Adds new well-known ULR for this purpose. 18 1 19 2021-02-19 Imanol Fernandez <ifernandez@igalia.com> and Sergio Villar Senin <svillar@igalia.com> 2 20 -
trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp
r273088 r273133 39 39 static const char privateClickMeasurementTriggerAttributionPath[] = "/.well-known/private-click-measurement/trigger-attribution/"; 40 40 static const char privateClickMeasurementTokenSignaturePath[] = "/.well-known/private-click-measurement/sign-unlinkable-token/"; 41 static const char privateClickMeasurementTokenPublicKeyPath[] = "/.well-known/private-click-measurement/get-unlinkable-token-public-key/"; 41 42 static const char privateClickMeasurementReportAttributionPath[] = "/.well-known/private-click-measurement/report-attribution/"; 42 43 const size_t privateClickMeasurementAttributionTriggerDataPathSegmentSize = 2; … … 133 134 } 134 135 136 URL PrivateClickMeasurement::tokenPublicKeyURL() const 137 { 138 StringBuilder builder; 139 builder.appendLiteral("https://"); 140 builder.append(m_sourceSite.registrableDomain.string()); 141 builder.appendLiteral(privateClickMeasurementTokenPublicKeyPath); 142 143 URL url { URL(), builder.toString() }; 144 if (url.isValid()) 145 return url; 146 147 return URL(); 148 } 149 135 150 Ref<JSON::Object> PrivateClickMeasurement::tokenSignatureJSON() const 136 151 { -
trunk/Source/WebCore/loader/PrivateClickMeasurement.h
r273088 r273133 278 278 WEBCORE_EXPORT Optional<Seconds> attributeAndGetEarliestTimeToSend(AttributionTriggerData&&); 279 279 WEBCORE_EXPORT bool hasHigherPriorityThan(const PrivateClickMeasurement&) const; 280 WEBCORE_EXPORT URL tokenPublicKeyURL() const; 280 281 WEBCORE_EXPORT URL tokenSignatureURL() const; 281 282 WEBCORE_EXPORT Ref<JSON::Object> tokenSignatureJSON() const; -
trunk/Source/WebKit/ChangeLog
r273131 r273133 1 2021-02-19 Jiewen Tan <jiewen_tan@apple.com> 2 3 PCM: Request server public key to generate secret token 4 https://bugs.webkit.org/show_bug.cgi?id=222141 5 <rdar://problem/74462955> 6 7 Reviewed by John Wilander. 8 9 * NetworkProcess/NetworkProcess.cpp: 10 (WebKit::NetworkProcess::setPrivateClickMeasurementTokenPublicKeyURLForTesting): 11 * NetworkProcess/NetworkProcess.h: 12 * NetworkProcess/NetworkProcess.messages.in: 13 * NetworkProcess/NetworkSession.cpp: 14 (WebKit::NetworkSession::setPrivateClickMeasurementTokenPublicKeyURLForTesting): 15 * NetworkProcess/NetworkSession.h: 16 Paperwork to add a way to set test URL. 17 18 * NetworkProcess/PrivateClickMeasurementManager.cpp: 19 (WebKit::PrivateClickMeasurementManager::storeUnattributed): 20 (WebKit::generateNetworkResourceLoadParameters): 21 (WebKit::generateNetworkResourceLoadParametersForPost): 22 (WebKit::generateNetworkResourceLoadParametersForGet): 23 (WebKit::PrivateClickMeasurementManager::getTokenPublicKey): 24 (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken): 25 (WebKit::PrivateClickMeasurementManager::fireConversionRequest): 26 (WebKit::PrivateClickMeasurementManager::setTokenPublicKeyURLForTesting): 27 * NetworkProcess/PrivateClickMeasurementManager.h: 28 Teaches the PCMM to send the token public key request. 29 30 * UIProcess/API/C/WKPage.cpp: 31 (WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTesting): 32 * UIProcess/API/C/WKPagePrivate.h: 33 * UIProcess/WebPageProxy.cpp: 34 (WebKit::WebPageProxy::simulateResourceLoadStatisticsSessionRestart): 35 (WebKit::WebPageProxy::setPrivateClickMeasurementTokenPublicKeyURLForTesting): 36 * UIProcess/WebPageProxy.h: 37 Paperwork to add a way to set test URL. 38 1 39 2021-02-19 Michael Catanzaro <mcatanzaro@gnome.org> 2 40 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r273102 r273133 2609 2609 } 2610 2610 2611 void NetworkProcess::setPrivateClickMeasurementTokenPublicKeyURLForTesting(PAL::SessionID sessionID, URL&& url, CompletionHandler<void()>&& completionHandler) 2612 { 2613 if (auto* session = networkSession(sessionID)) 2614 session->setPrivateClickMeasurementTokenPublicKeyURLForTesting(WTFMove(url)); 2615 2616 completionHandler(); 2617 } 2618 2611 2619 void NetworkProcess::setPrivateClickMeasurementTokenSignatureURLForTesting(PAL::SessionID sessionID, URL&& url, CompletionHandler<void()>&& completionHandler) 2612 2620 { -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r273102 r273133 343 343 void markAttributedPrivateClickMeasurementsAsExpiredForTesting(PAL::SessionID, CompletionHandler<void()>&&); 344 344 void simulateResourceLoadStatisticsSessionRestart(PAL::SessionID, CompletionHandler<void()>&&); 345 void setPrivateClickMeasurementTokenPublicKeyURLForTesting(PAL::SessionID, URL&&, CompletionHandler<void()>&&); 345 346 void setPrivateClickMeasurementTokenSignatureURLForTesting(PAL::SessionID, URL&&, CompletionHandler<void()>&&); 346 347 void setPrivateClickMeasurementAttributionReportURLForTesting(PAL::SessionID, URL&&, CompletionHandler<void()>&&); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r273102 r273133 168 168 MarkAttributedPrivateClickMeasurementsAsExpiredForTesting(PAL::SessionID sessionID) -> () Async 169 169 SimulateResourceLoadStatisticsSessionRestart(PAL::SessionID sessionID) -> () Async 170 SetPrivateClickMeasurementTokenPublicKeyURLForTesting(PAL::SessionID sessionID, URL url) -> () Async 170 171 SetPrivateClickMeasurementTokenSignatureURLForTesting(PAL::SessionID sessionID, URL url) -> () Async 171 172 SetPrivateClickMeasurementAttributionReportURLForTesting(PAL::SessionID sessionID, URL url) -> () Async -
trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp
r273088 r273133 339 339 } 340 340 341 void NetworkSession::setPrivateClickMeasurementTokenPublicKeyURLForTesting(URL&& url) 342 { 343 privateClickMeasurement().setTokenPublicKeyURLForTesting(WTFMove(url)); 344 } 345 341 346 void NetworkSession::setPrivateClickMeasurementTokenSignatureURLForTesting(URL&& url) 342 347 { -
trunk/Source/WebKit/NetworkProcess/NetworkSession.h
r273088 r273133 124 124 void setPrivateClickMeasurementOverrideTimerForTesting(bool value); 125 125 void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&); 126 void setPrivateClickMeasurementTokenPublicKeyURLForTesting(URL&&); 126 127 void setPrivateClickMeasurementTokenSignatureURLForTesting(URL&&); 127 128 void setPrivateClickMeasurementAttributionReportURLForTesting(URL&&); -
trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp
r273088 r273133 75 75 clearExpired(); 76 76 77 if (attribution.ephemeralSourceNonce()) 78 getSignedUnlinkableToken(attribution); 77 if (attribution.ephemeralSourceNonce()) { 78 auto attributionCopy = attribution; 79 getTokenPublicKey(WTFMove(attributionCopy)); 80 } 79 81 80 82 m_networkProcess->broadcastConsoleMessage(m_sessionID, MessageSource::PrivateClickMeasurement, MessageLevel::Log, "[Private Click Measurement] Storing an ad click."_s); … … 86 88 } 87 89 88 static NetworkResourceLoadParameters generateNetworkResourceLoadParameters(URL&& url, Ref<JSON::Object>jsonPayload, PrivateClickMeasurement::PcmDataCarried dataTypeCarried)90 static NetworkResourceLoadParameters generateNetworkResourceLoadParameters(URL&& url, const String& httpMethod, RefPtr<JSON::Object>&& jsonPayload, PrivateClickMeasurement::PcmDataCarried dataTypeCarried) 89 91 { 90 92 static uint64_t identifier = 0; 91 93 92 94 ResourceRequest request { WTFMove(url) }; 93 request.setHTTPMethod( "POST"_s);95 request.setHTTPMethod(httpMethod); 94 96 request.setHTTPHeaderField(HTTPHeaderName::CacheControl, WebCore::HTTPHeaderValues::maxAge0()); 95 request.setHTTPContentType(WebCore::HTTPHeaderValues::applicationJSONContentType()); 96 request.setHTTPBody(WebCore::FormData::create(jsonPayload->toJSONString().utf8().data())); 97 if (jsonPayload) { 98 request.setHTTPContentType(WebCore::HTTPHeaderValues::applicationJSONContentType()); 99 request.setHTTPBody(WebCore::FormData::create(jsonPayload->toJSONString().utf8().data())); 100 } 97 101 98 102 FetchOptions options; … … 113 117 } 114 118 115 void PrivateClickMeasurementManager::getSignedUnlinkableToken(const PrivateClickMeasurement& attribution) 116 { 117 if (!featureEnabled()) 118 return; 119 119 static NetworkResourceLoadParameters generateNetworkResourceLoadParametersForHttpPost(URL&& url, Ref<JSON::Object>&& jsonPayload, PrivateClickMeasurement::PcmDataCarried dataTypeCarried) 120 { 121 return generateNetworkResourceLoadParameters(WTFMove(url), "POST"_s, WTFMove(jsonPayload), dataTypeCarried); 122 } 123 124 static NetworkResourceLoadParameters generateNetworkResourceLoadParametersForHttpGet(URL&& url, PrivateClickMeasurement::PcmDataCarried dataTypeCarried) 125 { 126 return generateNetworkResourceLoadParameters(WTFMove(url), "GET"_s, nullptr, dataTypeCarried); 127 } 128 129 void PrivateClickMeasurementManager::getTokenPublicKey(PrivateClickMeasurement&& attribution) 130 { 131 if (!featureEnabled()) 132 return; 133 134 // This is guaranteed to be close in time to the navigational click which makes it likely to be personally identifiable. 135 auto tokenPublicKeyURL = attribution.tokenPublicKeyURL(); 136 auto pcmDataCarried = PrivateClickMeasurement::PcmDataCarried::PersonallyIdentifiable; 137 if (m_tokenPublicKeyURLForTesting) { 138 tokenPublicKeyURL = *m_tokenPublicKeyURLForTesting; 139 pcmDataCarried = PrivateClickMeasurement::PcmDataCarried::NonPersonallyIdentifiable; 140 } 141 142 if (tokenPublicKeyURL.isEmpty() || !tokenPublicKeyURL.isValid()) 143 return; 144 145 auto loadParameters = generateNetworkResourceLoadParametersForHttpGet(WTFMove(tokenPublicKeyURL), pcmDataCarried); 146 147 RELEASE_LOG_INFO(PrivateClickMeasurement, "About to fire a unlinkable token public key request."); 148 m_networkProcess->broadcastConsoleMessage(m_sessionID, MessageSource::PrivateClickMeasurement, MessageLevel::Log, "[Private Click Measurement] About to fire a unlinkable token public key request."_s); 149 150 m_pingLoadFunction(WTFMove(loadParameters), [weakThis = makeWeakPtr(*this), attribution = WTFMove(attribution), this] (const WebCore::ResourceError& error, const WebCore::ResourceResponse& response) mutable { 151 if (!weakThis) 152 return; 153 154 if (!error.isNull()) { 155 m_networkProcess->broadcastConsoleMessage(weakThis->m_sessionID, MessageSource::PrivateClickMeasurement, MessageLevel::Error, makeString("[Private Click Measurement] Received error: '"_s, error.localizedDescription(), "' for unlinkable token public key request."_s)); 156 return; 157 } 158 159 // FIXME: Receive and extra the server public key, rdar://73582032. 160 getSignedUnlinkableToken(WTFMove(attribution)); 161 }); 162 163 } 164 165 void PrivateClickMeasurementManager::getSignedUnlinkableToken(PrivateClickMeasurement&& attribution) 166 { 167 if (!featureEnabled()) 168 return; 169 170 // This is guaranteed to be close in time to the navigational click which makes it likely to be personally identifiable. 120 171 auto tokenSignatureURL = attribution.tokenSignatureURL(); 121 172 auto pcmDataCarried = PrivateClickMeasurement::PcmDataCarried::PersonallyIdentifiable; … … 128 179 return; 129 180 130 auto loadParameters = generateNetworkResourceLoadParameters (WTFMove(tokenSignatureURL), attribution.tokenSignatureJSON(), pcmDataCarried);181 auto loadParameters = generateNetworkResourceLoadParametersForHttpPost(WTFMove(tokenSignatureURL), attribution.tokenSignatureJSON(), pcmDataCarried); 131 182 132 183 RELEASE_LOG_INFO(PrivateClickMeasurement, "About to fire a unlinkable token signing request."); … … 208 259 return; 209 260 210 auto loadParameters = generateNetworkResourceLoadParameters (WTFMove(attributionURL), attribution.attributionReportJSON(), PrivateClickMeasurement::PcmDataCarried::NonPersonallyIdentifiable);261 auto loadParameters = generateNetworkResourceLoadParametersForHttpPost(WTFMove(attributionURL), attribution.attributionReportJSON(), PrivateClickMeasurement::PcmDataCarried::NonPersonallyIdentifiable); 211 262 212 263 RELEASE_LOG_INFO(PrivateClickMeasurement, "About to fire an attribution request."); … … 337 388 } 338 389 390 void PrivateClickMeasurementManager::setTokenPublicKeyURLForTesting(URL&& testURL) 391 { 392 if (testURL.isEmpty()) 393 return; 394 m_tokenPublicKeyURLForTesting = WTFMove(testURL); 395 } 396 339 397 void PrivateClickMeasurementManager::setTokenSignatureURLForTesting(URL&& testURL) 340 398 { -
trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.h
r273088 r273133 62 62 void setPingLoadFunction(Function<void(NetworkResourceLoadParameters&&, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&&)>&& pingLoadFunction) { m_pingLoadFunction = WTFMove(pingLoadFunction); } 63 63 void setOverrideTimerForTesting(bool value) { m_isRunningTest = value; } 64 void setTokenPublicKeyURLForTesting(URL&&); 64 65 void setTokenSignatureURLForTesting(URL&&); 65 66 void setAttributionReportURLForTesting(URL&&); … … 69 70 70 71 private: 71 void getSignedUnlinkableToken(const PrivateClickMeasurement&); 72 void getTokenPublicKey(PrivateClickMeasurement&&); 73 void getSignedUnlinkableToken(PrivateClickMeasurement&&); 72 74 void clearSentAttribution(PrivateClickMeasurement&&); 73 75 void attribute(const SourceSite&, const AttributeOnSite&, AttributionTriggerData&&); … … 80 82 WebCore::Timer m_firePendingAttributionRequestsTimer; 81 83 bool m_isRunningTest { false }; 84 Optional<URL> m_tokenPublicKeyURLForTesting; 82 85 Optional<URL> m_tokenSignatureURLForTesting; 83 86 Optional<URL> m_attributionReportBaseURLForTesting; -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r273088 r273133 2946 2946 } 2947 2947 2948 void WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTesting(WKPageRef page, WKURLRef URLRef, WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTestingFunction callback, void* callbackContext) 2949 { 2950 toImpl(page)->setPrivateClickMeasurementTokenPublicKeyURLForTesting(URL(URL(), toWTFString(URLRef)), [callbackContext, callback] () { 2951 callback(callbackContext); 2952 }); 2953 } 2954 2948 2955 void WKPageSetPrivateClickMeasurementTokenSignatureURLForTesting(WKPageRef page, WKURLRef URLRef, WKPageSetPrivateClickMeasurementTokenSignatureURLForTestingFunction callback, void* callbackContext) 2949 2956 { -
trunk/Source/WebKit/UIProcess/API/C/WKPagePrivate.h
r273088 r273133 180 180 typedef void (*WKPageSimulateResourceLoadStatisticsSessionRestartFunction)(void* functionContext); 181 181 WK_EXPORT void WKPageSimulateResourceLoadStatisticsSessionRestart(WKPageRef page, WKPageSimulateResourceLoadStatisticsSessionRestartFunction callback, void* callbackContext); 182 typedef void (*WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTestingFunction)(void* functionContext); 183 WK_EXPORT void WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTesting(WKPageRef page, WKURLRef urlString, WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTestingFunction callback, void* callbackContext); 182 184 typedef void (*WKPageSetPrivateClickMeasurementTokenSignatureURLForTestingFunction)(void* functionContext); 183 185 WK_EXPORT void WKPageSetPrivateClickMeasurementTokenSignatureURLForTesting(WKPageRef page, WKURLRef urlString, WKPageSetPrivateClickMeasurementTokenSignatureURLForTestingFunction callback, void* callbackContext); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r273120 r273133 10024 10024 } 10025 10025 10026 void WebPageProxy::setPrivateClickMeasurementTokenPublicKeyURLForTesting(const URL& url, CompletionHandler<void()>&& completionHandler) 10027 { 10028 websiteDataStore().networkProcess().sendWithAsyncReply(Messages::NetworkProcess::SetPrivateClickMeasurementTokenPublicKeyURLForTesting(m_websiteDataStore->sessionID(), url), WTFMove(completionHandler)); 10029 } 10030 10026 10031 void WebPageProxy::setPrivateClickMeasurementTokenSignatureURLForTesting(const URL& url, CompletionHandler<void()>&& completionHandler) 10027 10032 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r273102 r273133 1692 1692 void markAttributedPrivateClickMeasurementsAsExpiredForTesting(CompletionHandler<void()>&&); 1693 1693 void simulateResourceLoadStatisticsSessionRestart(CompletionHandler<void()>&&); 1694 void setPrivateClickMeasurementTokenPublicKeyURLForTesting(const URL&, CompletionHandler<void()>&&); 1694 1695 void setPrivateClickMeasurementTokenSignatureURLForTesting(const URL&, CompletionHandler<void()>&&); 1695 1696 void setPrivateClickMeasurementAttributionReportURLForTesting(const URL&, CompletionHandler<void()>&&); -
trunk/Tools/ChangeLog
r273130 r273133 1 2021-02-19 Jiewen Tan <jiewen_tan@apple.com> 2 3 PCM: Request server public key to generate secret token 4 https://bugs.webkit.org/show_bug.cgi?id=222141 5 <rdar://problem/74462955> 6 7 Reviewed by John Wilander. 8 9 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 10 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 11 (WTR::TestRunner::setPrivateClickMeasurementTokenPublicKeyURLForTesting): 12 * WebKitTestRunner/InjectedBundle/TestRunner.h: 13 * WebKitTestRunner/TestController.cpp: 14 (WTR::TestController::setPrivateClickMeasurementTokenPublicKeyURLForTesting): 15 * WebKitTestRunner/TestController.h: 16 * WebKitTestRunner/TestInvocation.cpp: 17 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 18 Paperwork to add a way to set test URL. 19 1 20 2021-02-19 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r273088 r273133 404 404 undefined markAttributedPrivateClickMeasurementsAsExpiredForTesting(); 405 405 undefined simulateResourceLoadStatisticsSessionRestart(); 406 undefined setPrivateClickMeasurementTokenPublicKeyURLForTesting(DOMString url); 406 407 undefined setPrivateClickMeasurementTokenSignatureURLForTesting(DOMString url); 407 408 undefined setPrivateClickMeasurementAttributionReportURLForTesting(DOMString url); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r273088 r273133 2026 2026 } 2027 2027 2028 void TestRunner::setPrivateClickMeasurementTokenPublicKeyURLForTesting(JSStringRef urlString) 2029 { 2030 postSynchronousPageMessage("SetPrivateClickMeasurementTokenPublicKeyURLForTesting", 2031 adoptWK(WKURLCreateWithUTF8CString(toWTFString(urlString).utf8().data()))); 2032 } 2033 2028 2034 void TestRunner::setPrivateClickMeasurementTokenSignatureURLForTesting(JSStringRef urlString) 2029 2035 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r273088 r273133 513 513 void clearPrivateClickMeasurementsThroughWebsiteDataRemoval(); 514 514 void setPrivateClickMeasurementOverrideTimerForTesting(bool value); 515 void setPrivateClickMeasurementTokenPublicKeyURLForTesting(JSStringRef); 515 516 void setPrivateClickMeasurementTokenSignatureURLForTesting(JSStringRef); 516 517 void setPrivateClickMeasurementAttributionReportURLForTesting(JSStringRef); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r273088 r273133 3631 3631 } 3632 3632 3633 void TestController::setPrivateClickMeasurementTokenPublicKeyURLForTesting(WKURLRef url) 3634 { 3635 PrivateClickMeasurementVoidCallbackContext callbackContext(*this); 3636 WKPageSetPrivateClickMeasurementTokenPublicKeyURLForTesting(m_mainWebView->page(), url, privateClickMeasurementVoidCallback, &callbackContext); 3637 runUntil(callbackContext.done, noTimeout); 3638 } 3639 3633 3640 void TestController::setPrivateClickMeasurementTokenSignatureURLForTesting(WKURLRef url) 3634 3641 { -
trunk/Tools/WebKitTestRunner/TestController.h
r273088 r273133 347 347 void markAttributedPrivateClickMeasurementsAsExpiredForTesting(); 348 348 void simulateResourceLoadStatisticsSessionRestart(); 349 void setPrivateClickMeasurementTokenPublicKeyURLForTesting(WKURLRef); 349 350 void setPrivateClickMeasurementTokenSignatureURLForTesting(WKURLRef); 350 351 void setPrivateClickMeasurementAttributionReportURLForTesting(WKURLRef); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r273088 r273133 1340 1340 } 1341 1341 1342 if (WKStringIsEqualToUTF8CString(messageName, "SetPrivateClickMeasurementTokenPublicKeyURLForTesting")) { 1343 ASSERT(WKGetTypeID(messageBody) == WKURLGetTypeID()); 1344 TestController::singleton().setPrivateClickMeasurementTokenPublicKeyURLForTesting(static_cast<WKURLRef>(messageBody)); 1345 return nullptr; 1346 } 1347 1342 1348 if (WKStringIsEqualToUTF8CString(messageName, "SetPrivateClickMeasurementTokenSignatureURLForTesting")) { 1343 1349 ASSERT(WKGetTypeID(messageBody) == WKURLGetTypeID());
Note: See TracChangeset
for help on using the changeset viewer.