Changeset 244818 in webkit
- Timestamp:
- Apr 30, 2019 7:28:07 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r244815 r244818 1 2019-04-30 John Wilander <wilander@apple.com> 2 3 Add logging of Ad Click Attribution errors and events to a dedicated channel 4 https://bugs.webkit.org/show_bug.cgi?id=197332 5 <rdar://problem/49918800> 6 7 Reviewed by Youenn Fablet. 8 9 Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies 10 for RELEASE_LOG_DISABLED. 11 12 * wtf/Assertions.h: 13 1 14 2019-04-30 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/WTF/wtf/Assertions.h
r243141 r244818 491 491 #define RELEASE_LOG_ERROR(channel, ...) LOG_ERROR(__VA_ARGS__) 492 492 #define RELEASE_LOG_FAULT(channel, ...) LOG_ERROR(__VA_ARGS__) 493 #define RELEASE_LOG_INFO(channel, ...) ((void)0) 493 494 494 495 #define RELEASE_LOG_IF(isAllowed, channel, ...) ((void)0) 495 496 #define RELEASE_LOG_ERROR_IF(isAllowed, channel, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, __VA_ARGS__); } while (0) 497 #define RELEASE_LOG_INFO_IF(isAllowed, channel, ...) ((void)0) 496 498 497 499 #define RELEASE_LOG_WITH_LEVEL(channel, level, ...) ((void)0) -
trunk/Source/WebCore/ChangeLog
r244817 r244818 1 2019-04-30 John Wilander <wilander@apple.com> 2 3 Add logging of Ad Click Attribution errors and events to a dedicated channel 4 https://bugs.webkit.org/show_bug.cgi?id=197332 5 <rdar://problem/49918800> 6 7 Reviewed by Youenn Fablet. 8 9 This patch adds an experimental Ad Click Attribution debug mode which 10 logs information. 11 12 No new tests. 13 14 * loader/AdClickAttribution.cpp: 15 (WebCore::AdClickAttribution::parseConversionRequest): 16 (WebCore::AdClickAttribution::debugModeEnabled): 17 * loader/AdClickAttribution.h: 18 * page/RuntimeEnabledFeatures.h: 19 (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const): 20 (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled): 21 * platform/Logging.h: 22 1 23 2019-04-30 Myles C. Maxfield <mmaxfield@apple.com> 2 24 -
trunk/Source/WebCore/loader/AdClickAttribution.cpp
r244614 r244818 27 27 #include "AdClickAttribution.h" 28 28 29 #include "Logging.h" 30 #include "RuntimeEnabledFeatures.h" 29 31 #include <wtf/RandomNumber.h> 30 32 #include <wtf/URL.h> … … 51 53 Optional<AdClickAttribution::Conversion> AdClickAttribution::parseConversionRequest(const URL& redirectURL) 52 54 { 53 if (!redirectURL.protocolIs("https"_s) || redirectURL.hasUsername() || redirectURL.hasPassword() || redirectURL.hasQuery() || redirectURL.hasFragment()) 55 if (!redirectURL.protocolIs("https"_s) || redirectURL.hasUsername() || redirectURL.hasPassword() || redirectURL.hasQuery() || redirectURL.hasFragment()) { 56 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the URL's protocol is not HTTPS or the URL contains one or more of username, password, query string, and fragment."); 54 57 return { }; 58 } 55 59 56 60 auto path = StringView(redirectURL.string()).substring(redirectURL.pathStart(), redirectURL.pathEnd() - redirectURL.pathStart()); 57 if (path.isEmpty() || !path.startsWith(adClickAttributionPathPrefix)) 61 if (path.isEmpty() || !path.startsWith(adClickAttributionPathPrefix)) { 62 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the URL path did not start with %{public}s.", adClickAttributionPathPrefix); 58 63 return { }; 64 } 59 65 60 66 auto prefixLength = sizeof(adClickAttributionPathPrefix) - 1; 61 67 if (path.length() == prefixLength + adClickConversionDataPathSegmentSize) { 62 68 auto conversionDataUInt64 = path.substring(prefixLength, adClickConversionDataPathSegmentSize).toUInt64Strict(); 63 if (!conversionDataUInt64 || *conversionDataUInt64 > MaxEntropy) 69 if (!conversionDataUInt64 || *conversionDataUInt64 > MaxEntropy) { 70 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the conversion data could not be parsed or was higher than the allowed maximum of %{public}u.", MaxEntropy); 64 71 return { }; 72 } 65 73 66 74 return Conversion { static_cast<uint32_t>(*conversionDataUInt64), Priority { 0 } }; … … 69 77 if (path.length() == prefixLength + adClickConversionDataPathSegmentSize + 1 + adClickPriorityPathSegmentSize) { 70 78 auto conversionDataUInt64 = path.substring(prefixLength, adClickConversionDataPathSegmentSize).toUInt64Strict(); 71 if (!conversionDataUInt64 || *conversionDataUInt64 > MaxEntropy) 79 if (!conversionDataUInt64 || *conversionDataUInt64 > MaxEntropy) { 80 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the conversion data could not be parsed or was higher than the allowed maximum of %{public}u.", MaxEntropy); 72 81 return { }; 82 } 73 83 74 84 auto conversionPriorityUInt64 = path.substring(prefixLength + adClickConversionDataPathSegmentSize + 1, adClickPriorityPathSegmentSize).toUInt64Strict(); 75 if (!conversionPriorityUInt64 || *conversionPriorityUInt64 > MaxEntropy) 85 if (!conversionPriorityUInt64 || *conversionPriorityUInt64 > MaxEntropy) { 86 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the priority could not be parsed or was higher than the allowed maximum of %{public}u.", MaxEntropy); 76 87 return { }; 88 } 77 89 78 90 return Conversion { static_cast<uint32_t>(*conversionDataUInt64), Priority { static_cast<uint32_t>(*conversionPriorityUInt64) } }; 79 91 } 80 92 93 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the URL path contained unrecognized parts."); 81 94 return { }; 82 95 } … … 84 97 Optional<Seconds> AdClickAttribution::convertAndGetEarliestTimeToSend(Conversion&& conversion) 85 98 { 86 if (!conversion.isValid() || (m_conversion && m_conversion->priority > conversion.priority))99 if (!conversion.isValid() || (m_conversion && m_conversion->priority >= conversion.priority)) 87 100 return { }; 88 101 … … 213 226 } 214 227 215 } 228 bool AdClickAttribution::debugModeEnabled() 229 { 230 return RuntimeEnabledFeatures::sharedFeatures().adClickAttributionDebugModeEnabled(); 231 } 232 233 } -
trunk/Source/WebCore/loader/AdClickAttribution.h
r244614 r244818 263 263 private: 264 264 bool isValid() const; 265 static bool debugModeEnabled(); 265 266 266 267 Campaign m_campaign; -
trunk/Source/WebCore/page/RuntimeEnabledFeatures.h
r244202 r244818 342 342 bool adClickAttributionEnabled() const { return m_adClickAttributionEnabled; } 343 343 void setAdClickAttributionEnabled(bool isEnabled) { m_adClickAttributionEnabled = isEnabled; } 344 bool adClickAttributionDebugModeEnabled() const { return m_adClickAttributionDebugModeEnabled; } 345 void setAdClickAttributionDebugModeEnabled(bool isEnabled) { m_adClickAttributionDebugModeEnabled = isEnabled; } 344 346 345 347 #if ENABLE(TOUCH_EVENTS) … … 526 528 527 529 bool m_adClickAttributionEnabled { false }; 530 bool m_adClickAttributionDebugModeEnabled { false }; 528 531 529 532 #if ENABLE(TOUCH_EVENTS) -
trunk/Source/WebCore/platform/Logging.h
r244092 r244818 39 39 40 40 #define WEBCORE_LOG_CHANNELS(M) \ 41 M(AdClickAttribution) \ 41 42 M(Animations) \ 42 43 M(ApplePay) \ -
trunk/Source/WebKit/ChangeLog
r244814 r244818 1 2019-04-30 John Wilander <wilander@apple.com> 2 3 Add logging of Ad Click Attribution errors and events to a dedicated channel 4 https://bugs.webkit.org/show_bug.cgi?id=197332 5 <rdar://problem/49918800> 6 7 Reviewed by Youenn Fablet. 8 9 This patch adds an experimental Ad Click Attribution debug mode which 10 logs information. Most changes are just log output in the various 11 functions in WebKit::AdClickAttributionManager. 12 13 The constructor to WebKit::AdClickAttributionManager now takes a 14 PAL::SessionID so that the log functions can make sure they don't 15 output anything in ephemeral sessions. 16 17 WebProcessPool::platformInitializeNetworkProcess() now picks up the 18 debug mode setting from the incoming 19 WebKit::NetworkProcessCreationParameters object. 20 21 NetworkResourceLoader::handleAdClickAttributionConversion() was 22 moved to AdClickAttributionManager::handleConversion() to keep all 23 the logging in one file. 24 25 * NetworkProcess/AdClickAttributionManager.cpp: 26 (WebKit::AdClickAttributionManager::storeUnconverted): 27 (WebKit::AdClickAttributionManager::handleConversion): 28 (WebKit::AdClickAttributionManager::convert): 29 (WebKit::AdClickAttributionManager::fireConversionRequest): 30 (WebKit::AdClickAttributionManager::firePendingConversionRequests): 31 (WebKit::AdClickAttributionManager::clearExpired): 32 (WebKit::AdClickAttributionManager::debugModeEnabled const): 33 * NetworkProcess/AdClickAttributionManager.h: 34 (WebKit::AdClickAttributionManager::AdClickAttributionManager): 35 (WebKit::AdClickAttributionManager::m_sessionID): 36 * NetworkProcess/NetworkProcess.cpp: 37 (WebKit::NetworkProcess::initializeNetworkProcess): 38 * NetworkProcess/NetworkProcessCreationParameters.cpp: 39 (WebKit::NetworkProcessCreationParameters::encode const): 40 (WebKit::NetworkProcessCreationParameters::decode): 41 * NetworkProcess/NetworkProcessCreationParameters.h: 42 * NetworkProcess/NetworkResourceLoader.cpp: 43 (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): 44 (WebKit::NetworkResourceLoader::handleAdClickAttributionConversion): Deleted. 45 * NetworkProcess/NetworkSession.cpp: 46 (WebKit::NetworkSession::NetworkSession): 47 (WebKit::NetworkSession::handleAdClickAttributionConversion): 48 (WebKit::NetworkSession::convertAdClickAttribution): Deleted. 49 * NetworkProcess/NetworkSession.h: 50 * Platform/Logging.h: 51 * Shared/WebPreferences.yaml: 52 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 53 (WebKit::WebProcessPool::platformInitializeNetworkProcess): 54 1 55 2019-04-30 Devin Rousso <drousso@apple.com> 2 56 -
trunk/Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp
r244614 r244818 27 27 #include "AdClickAttributionManager.h" 28 28 29 #include "Logging.h" 29 30 #include <WebCore/FetchOptions.h> 30 31 #include <WebCore/FormData.h> … … 33 34 #include <WebCore/ResourceResponse.h> 34 35 #include <WebCore/RuntimeApplicationChecks.h> 36 #include <WebCore/RuntimeEnabledFeatures.h> 35 37 #include <wtf/text/StringBuilder.h> 36 38 #include <wtf/text/StringHash.h> … … 44 46 using Conversion = AdClickAttribution::Conversion; 45 47 48 constexpr Seconds debugModeSecondsUntilSend { 60_s }; 49 46 50 void AdClickAttributionManager::storeUnconverted(AdClickAttribution&& attribution) 47 51 { 48 52 clearExpired(); 49 53 54 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Storing an ad click."); 50 55 m_unconvertedAdClickAttributionMap.set(std::make_pair(attribution.source(), attribution.destination()), WTFMove(attribution)); 51 56 } 52 57 58 void AdClickAttributionManager::handleConversion(Conversion&& conversion, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest) 59 { 60 if (m_sessionID.isEphemeral()) 61 return; 62 63 RegistrableDomain redirectDomain { redirectRequest.url() }; 64 auto& firstPartyURL = redirectRequest.firstPartyForCookies(); 65 66 if (!redirectDomain.matches(requestURL)) { 67 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because the HTTP redirect was not same-site."); 68 return; 69 } 70 71 if (redirectDomain.matches(firstPartyURL)) { 72 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Conversion was not accepted because it was requested in an HTTP redirect that is same-site as the first-party."); 73 return; 74 } 75 76 convert(AdClickAttribution::Source { WTFMove(redirectDomain) }, AdClickAttribution::Destination { firstPartyURL }, WTFMove(conversion)); 77 } 78 53 79 void AdClickAttributionManager::startTimer(Seconds seconds) 54 80 { … … 60 86 clearExpired(); 61 87 62 if (!conversion.isValid()) 63 return; 88 if (!conversion.isValid()) { 89 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Got an invalid conversion."); 90 return; 91 } 92 93 #if !RELEASE_LOG_DISABLED 94 auto conversionData = conversion.data; 95 auto conversionPriority = conversion.priority; 96 #endif 97 98 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Got a conversion with conversion data: %{public}u and priority: %{public}u.", conversionData, conversionPriority); 64 99 65 100 auto secondsUntilSend = Seconds::infinity(); … … 74 109 secondsUntilSend = *optionalSecondsUntilSend; 75 110 ASSERT(secondsUntilSend != Seconds::infinity()); 76 } 77 // If there is no previously converted attribution for this pair, add the new one. 78 // If the newly converted attribution has higher priority, replace the old one. 79 if (previouslyConvertedAttributionIter == m_convertedAdClickAttributionMap.end() 80 || previouslyUnconvertedAttribution.hasHigherPriorityThan(previouslyConvertedAttributionIter->value)) 111 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Converted a stored ad click with conversion data: %{public}u and priority: %{public}u.", conversionData, conversionPriority); 112 } 113 114 if (previouslyConvertedAttributionIter == m_convertedAdClickAttributionMap.end()) 115 m_convertedAdClickAttributionMap.add(pair, WTFMove(previouslyUnconvertedAttribution)); 116 else if (previouslyUnconvertedAttribution.hasHigherPriorityThan(previouslyConvertedAttributionIter->value)) { 117 // If the newly converted attribution has higher priority, replace the old one. 81 118 m_convertedAdClickAttributionMap.set(pair, WTFMove(previouslyUnconvertedAttribution)); 119 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Replaced a previously converted ad click with a new one with conversion data: %{public}u and priority: %{public}u because it had higher priority.", conversionData, conversionPriority); 120 } 82 121 } else if (previouslyConvertedAttributionIter != m_convertedAdClickAttributionMap.end()) { 83 122 // If we have no newly converted attribution, re-convert the old one to respect the new priority. … … 85 124 secondsUntilSend = *optionalSecondsUntilSend; 86 125 ASSERT(secondsUntilSend != Seconds::infinity()); 126 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "Re-converted an ad click with a new one with conversion data: %{public}u and priority: %{public}u because it had higher priority.", conversionData, conversionPriority); 87 127 } 88 128 } … … 93 133 if (m_firePendingConversionRequestsTimer.isActive() && m_firePendingConversionRequestsTimer.nextFireInterval() < secondsUntilSend) 94 134 return; 95 135 136 if (debugModeEnabled()) { 137 RELEASE_LOG_INFO(AdClickAttribution, "Setting timer for firing conversion requests to the debug mode timeout of %{public}f seconds where the regular timeout would have been %{public}f seconds.", debugModeSecondsUntilSend.seconds(), secondsUntilSend.seconds()); 138 secondsUntilSend = debugModeSecondsUntilSend; 139 } 140 96 141 startTimer(secondsUntilSend); 97 142 } … … 134 179 #endif 135 180 181 RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "About to fire an attribution request for a conversion."); 182 136 183 m_pingLoadFunction(WTFMove(loadParameters), [](const WebCore::ResourceError& error, const WebCore::ResourceResponse& response) { 137 // FIXME: Add logging of errors to a dedicated channel.184 RELEASE_LOG_ERROR_IF(!error.isNull(), AdClickAttribution, "Received error: '%{public}s' for ad click attribution request.", error.localizedDescription().utf8().data()); 138 185 UNUSED_PARAM(response); 139 186 UNUSED_PARAM(error); … … 156 203 157 204 auto now = WallTime::now(); 158 if (*earliestTimeToSend <= now || m_isRunningTest ) {205 if (*earliestTimeToSend <= now || m_isRunningTest || debugModeEnabled()) { 159 206 fireConversionRequest(attribution); 160 207 attribution.markConversionAsSent(); … … 248 295 } 249 296 297 bool AdClickAttributionManager::debugModeEnabled() const 298 { 299 return RuntimeEnabledFeatures::sharedFeatures().adClickAttributionDebugModeEnabled() && !m_sessionID.isEphemeral(); 300 } 301 250 302 } // namespace WebKit -
trunk/Source/WebKit/NetworkProcess/AdClickAttributionManager.h
r244614 r244818 34 34 #include <wtf/CompletionHandler.h> 35 35 #include <wtf/HashMap.h> 36 #include <wtf/WeakPtr.h> 36 37 #include <wtf/text/WTFString.h> 37 38 38 39 namespace WebKit { 39 40 40 class AdClickAttributionManager {41 class AdClickAttributionManager : public CanMakeWeakPtr<AdClickAttributionManager> { 41 42 public: 42 43 … … 47 48 using Conversion = WebCore::AdClickAttribution::Conversion; 48 49 49 AdClickAttributionManager()50 explicit AdClickAttributionManager(PAL::SessionID sessionID) 50 51 : m_firePendingConversionRequestsTimer(*this, &AdClickAttributionManager::firePendingConversionRequests) 51 52 , m_pingLoadFunction([](NetworkResourceLoadParameters&& params, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&& completionHandler) { … … 53 54 completionHandler(WebCore::ResourceError(), WebCore::ResourceResponse()); 54 55 }) 56 , m_sessionID(sessionID) 55 57 { 56 58 } 57 59 58 60 void storeUnconverted(AdClickAttribution&&); 59 void convert(const Source&, const Destination&, Conversion&&);61 void handleConversion(Conversion&&, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest); 60 62 void clear(); 61 63 void clearForRegistrableDomain(const RegistrableDomain&); … … 68 70 private: 69 71 void startTimer(Seconds); 72 void convert(const Source&, const Destination&, Conversion&&); 70 73 void fireConversionRequest(const AdClickAttribution&); 71 74 void firePendingConversionRequests(); 72 75 void clearExpired(); 76 bool debugModeEnabled() const; 73 77 74 78 HashMap<std::pair<Source, Destination>, AdClickAttribution> m_unconvertedAdClickAttributionMap; … … 78 82 bool m_isRunningTest { false }; 79 83 Optional<URL> m_conversionBaseURLForTesting; 84 PAL::SessionID m_sessionID; 80 85 }; 81 86 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r244700 r244818 307 307 WebCore::RuntimeEnabledFeatures::sharedFeatures().setIsITPFirstPartyWebsiteDataRemovalEnabled(parameters.isITPFirstPartyWebsiteDataRemovalEnabled); 308 308 309 WebCore::RuntimeEnabledFeatures::sharedFeatures().setAdClickAttributionDebugModeEnabled(parameters.enableAdClickAttributionDebugMode); 310 309 311 SandboxExtension::consumePermanently(parameters.defaultDataStoreParameters.networkSessionParameters.resourceLoadStatisticsDirectoryExtensionHandle); 310 312 -
trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
r243427 r244818 92 92 encoder << downloadMonitorSpeedMultiplier; 93 93 encoder << isITPFirstPartyWebsiteDataRemovalEnabled; 94 encoder << enableAdClickAttributionDebugMode; 94 95 } 95 96 … … 221 222 return false; 222 223 224 if (!decoder.decode(result.enableAdClickAttributionDebugMode)) 225 return false; 226 223 227 return true; 224 228 } -
trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
r243427 r244818 110 110 bool isITPFirstPartyWebsiteDataRemovalEnabled { true }; 111 111 uint32_t downloadMonitorSpeedMultiplier { 1 }; 112 bool enableAdClickAttributionDebugMode { false }; 112 113 }; 113 114 -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
r244700 r244818 601 601 } 602 602 603 void NetworkResourceLoader::handleAdClickAttributionConversion(AdClickAttribution::Conversion&& conversion, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest)604 {605 ASSERT(!sessionID().isEphemeral());606 607 RegistrableDomain redirectDomain { redirectRequest.url() };608 auto& firstPartyURL = redirectRequest.firstPartyForCookies();609 NetworkSession* networkSession = nullptr;610 // The redirect has to be done by the same registrable domain and it has to be a third-party request.611 if (redirectDomain.matches(requestURL) && !redirectDomain.matches(firstPartyURL) && (networkSession = m_connection->networkProcess().networkSession(sessionID())))612 networkSession->convertAdClickAttribution(AdClickAttribution::Source { WTFMove(redirectDomain) }, AdClickAttribution::Destination { firstPartyURL }, WTFMove(conversion));613 }614 615 603 void NetworkResourceLoader::willSendRedirectedRequest(ResourceRequest&& request, ResourceRequest&& redirectRequest, ResourceResponse&& redirectResponse) 616 604 { … … 673 661 } 674 662 675 if (adClickConversion) 676 handleAdClickAttributionConversion(WTFMove(*adClickConversion), request.url(), redirectRequest); 663 NetworkSession* networkSession = nullptr; 664 if (adClickConversion && (networkSession = m_connection->networkProcess().networkSession(sessionID()))) 665 networkSession->handleAdClickAttributionConversion(WTFMove(*adClickConversion), request.url(), redirectRequest); 666 677 667 send(Messages::WebResourceLoader::WillSendRequest(redirectRequest, sanitizeResponseIfPossible(WTFMove(redirectResponse), ResourceResponse::SanitizationType::Redirection))); 678 668 } -
trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp
r244700 r244818 38 38 #include <WebCore/CookieJar.h> 39 39 #include <WebCore/NetworkStorageSession.h> 40 #include <WebCore/ResourceRequest.h> 40 41 41 42 #if PLATFORM(COCOA) … … 75 76 : m_sessionID(sessionID) 76 77 , m_networkProcess(networkProcess) 77 , m_adClickAttribution(makeUniqueRef<AdClickAttributionManager>( ))78 , m_adClickAttribution(makeUniqueRef<AdClickAttributionManager>(sessionID)) 78 79 { 79 80 m_adClickAttribution->setPingLoadFunction([this, weakThis = makeWeakPtr(this)](NetworkResourceLoadParameters&& loadParameters, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&& completionHandler) { … … 150 151 } 151 152 152 void NetworkSession:: convertAdClickAttribution(const WebCore::AdClickAttribution::Source& source, const WebCore::AdClickAttribution::Destination& destination, WebCore::AdClickAttribution::Conversion&& conversion)153 { 154 m_adClickAttribution-> convert(source, destination, WTFMove(conversion));153 void NetworkSession::handleAdClickAttributionConversion(AdClickAttribution::Conversion&& conversion, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest) 154 { 155 m_adClickAttribution->handleConversion(WTFMove(conversion), requestURL, redirectRequest); 155 156 } 156 157 -
trunk/Source/WebKit/NetworkProcess/NetworkSession.h
r244700 r244818 40 40 namespace WebCore { 41 41 class NetworkStorageSession; 42 class ResourceRequest; 42 43 enum class IncludeHttpOnlyCookies : bool; 43 44 enum class ShouldSample : bool; … … 82 83 #endif 83 84 void storeAdClickAttribution(WebCore::AdClickAttribution&&); 84 void convertAdClickAttribution(const WebCore::AdClickAttribution::Source&, const WebCore::AdClickAttribution::Destination&, WebCore::AdClickAttribution::Conversion&&);85 void handleAdClickAttributionConversion(WebCore::AdClickAttribution::Conversion&&, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest); 85 86 void dumpAdClickAttribution(CompletionHandler<void(String)>&&); 86 87 void clearAdClickAttribution(); -
trunk/Source/WebKit/Platform/Logging.h
r243453 r244818 41 41 42 42 #define WEBKIT2_LOG_CHANNELS(M) \ 43 M(AdClickAttribution) \ 43 44 M(Automation) \ 44 45 M(ActivityState) \ -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r244702 r244818 1413 1413 category: experimental 1414 1414 1415 AdClickAttributionDebugModeEnabled: 1416 type: bool 1417 defaultValue: false 1418 humanReadableName: "Ad Click Attribution Debug Mode" 1419 humanReadableDescription: "Enable Ad Click Attribution Debug Mode" 1420 webcoreBinding: RuntimeEnabledFeatures 1421 category: experimental 1422 1415 1423 # For internal features: 1416 1424 # The type should be boolean. -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r243427 r244818 305 305 if ([isITPFirstPartyWebsiteDataRemovalEnabledStr isEqual:@"0"]) 306 306 parameters.isITPFirstPartyWebsiteDataRemovalEnabled = false; 307 308 parameters.enableAdClickAttributionDebugMode = [defaults boolForKey:[NSString stringWithFormat:@"Experimental%@", WebPreferencesKey::adClickAttributionDebugModeEnabledKey().createCFString().get()]]; 307 309 } 308 310
Note: See TracChangeset
for help on using the changeset viewer.