WebKit Bugzilla
Attachment 368365 Details for
Bug 197332
: Add logging of Ad Click Attribution errors and events to a dedicated channel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WiP-feedback-welcome
bug-197332-20190426165045.patch (text/plain), 32.79 KB, created by
John Wilander
on 2019-04-26 16:50:45 PDT
(
hide
)
Description:
WiP-feedback-welcome
Filename:
MIME Type:
Creator:
John Wilander
Created:
2019-04-26 16:50:45 PDT
Size:
32.79 KB
patch
obsolete
>Subversion Revision: 244711 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 5f2e64847da249ace9b7933c7efe91f052a908de..32b28f6c56eb15935e7d3516024bc9e34350fcd0 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-04-26 John Wilander <wilander@apple.com> >+ >+ Add logging of Ad Click Attribution errors and events to a dedicated channel >+ https://bugs.webkit.org/show_bug.cgi?id=197332 >+ <rdar://problem/49918800> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/ConsoleMessage.cpp: >+ (Inspector::messageSourceValue): >+ * inspector/protocol/Console.json: >+ * inspector/scripts/codegen/generator.py: >+ * runtime/ConsoleTypes.h: >+ > 2019-04-25 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] linkPolymorphicCall now does GC >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9964d1ee8c23af6a8d7a9eb130f635df5008fd63..5c5383155516dd415ad0d9ec3833effa09e826a5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-04-26 John Wilander <wilander@apple.com> >+ >+ Add logging of Ad Click Attribution errors and events to a dedicated channel >+ https://bugs.webkit.org/show_bug.cgi?id=197332 >+ <rdar://problem/49918800> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests. >+ >+ * dom/Document.cpp: >+ (WebCore::messageSourceForWTFLogChannel): >+ * html/HTMLAnchorElement.cpp: >+ (WebCore::HTMLAnchorElement::parseAdClickAttribution const): >+ * inspector/agents/page/PageConsoleAgent.cpp: >+ (WebCore::PageConsoleAgent::getLoggingChannels): >+ * platform/Logging.h: >+ > 2019-04-26 Robin Morisset <rmorisset@apple.com> > > All prototypes should call didBecomePrototype() >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 93c31c594cd75eaeee141fb5a186e23b46ac5c25..ecd19e9cac60ac0e6f77c0821a5cdc1a10f1b40f 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,25 @@ >+2019-04-26 John Wilander <wilander@apple.com> >+ >+ Add logging of Ad Click Attribution errors and events to a dedicated channel >+ https://bugs.webkit.org/show_bug.cgi?id=197332 >+ <rdar://problem/49918800> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ * UserInterface/Controllers/ConsoleManager.js: >+ (WI.ConsoleManager.prototype.initializeLogChannels): >+ * UserInterface/Models/ConsoleMessage.js: >+ * UserInterface/Models/IssueMessage.js: >+ (WI.IssueMessage): >+ * UserInterface/Models/LoggingChannel.js: >+ (WI.LoggingChannel): >+ * UserInterface/Views/LogContentView.js: >+ (WI.LogContentView): >+ (WI.LogContentView.prototype._scopeFromMessageSource): >+ * UserInterface/Views/SettingsTabContentView.js: >+ (WI.SettingsTabContentView.prototype._createGeneralSettingsView): >+ > 2019-04-25 Alex Christensen <achristensen@webkit.org> > > Start using C++17 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f13392681c79204a881044553834033aa1c2c7e4..3fa140b4520dd62d8648574d8f8a00fa5a90db33 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,27 @@ >+2019-04-26 John Wilander <wilander@apple.com> >+ >+ Add logging of Ad Click Attribution errors and events to a dedicated channel >+ https://bugs.webkit.org/show_bug.cgi?id=197332 >+ <rdar://problem/49918800> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/AdClickAttributionManager.cpp: >+ (WebKit::AdClickAttributionManager::storeUnconverted): >+ (WebKit::AdClickAttributionManager::convert): >+ (WebKit::AdClickAttributionManager::fireConversionRequest): >+ (WebKit::AdClickAttributionManager::firePendingConversionRequests): >+ (WebKit::AdClickAttributionManager::clearExpired): >+ (WebKit::AdClickAttributionManager::logChannel const): >+ (WebKit::AdClickAttributionManager::logger const): >+ (WebKit::AdClickAttributionManager::isAlwaysOnLoggingAllowed const): >+ * NetworkProcess/AdClickAttributionManager.h: >+ (WebKit::AdClickAttributionManager::AdClickAttributionManager): >+ (WebKit::AdClickAttributionManager::m_logIdentifier): >+ * NetworkProcess/NetworkSession.cpp: >+ (WebKit::NetworkSession::NetworkSession): >+ * Platform/Logging.h: >+ > 2019-04-26 Youenn Fablet <youenn@apple.com> > > Use kDNSServiceFlagsKnownUnique to speed up mdns name registration for ICE candidates >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index e6897e3dc68d9f38bf4ba6babee044efe9474ca8..0ed0b3496842ea5fae75aa1bfeaf61a313d26610 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,14 @@ >+2019-04-26 John Wilander <wilander@apple.com> >+ >+ Add logging of Ad Click Attribution errors and events to a dedicated channel >+ https://bugs.webkit.org/show_bug.cgi?id=197332 >+ <rdar://problem/49918800> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebChromeClient.mm: >+ (stringForMessageSource): >+ > 2019-04-26 Eric Carlson <eric.carlson@apple.com> > > Create AVFoundationSoftLink.{h,mm} to reduce duplicate code >diff --git a/Source/JavaScriptCore/inspector/ConsoleMessage.cpp b/Source/JavaScriptCore/inspector/ConsoleMessage.cpp >index f501e10176ed00f1334aab19dfd898e1ddc34078..2c973f938c4b1148fd6b1fafea399ee8c8ae6908 100644 >--- a/Source/JavaScriptCore/inspector/ConsoleMessage.cpp >+++ b/Source/JavaScriptCore/inspector/ConsoleMessage.cpp >@@ -171,6 +171,7 @@ static Protocol::Console::ChannelSource messageSourceValue(MessageSource source) > case MessageSource::Media: return Protocol::Console::ChannelSource::Media; > case MessageSource::WebRTC: return Protocol::Console::ChannelSource::WebRTC; > case MessageSource::MediaSource: return Protocol::Console::ChannelSource::MediaSource; >+ case MessageSource::AdClickAttribution: return Protocol::Console::ChannelSource::AdClickAttribution; > } > return Protocol::Console::ChannelSource::Other; > } >diff --git a/Source/JavaScriptCore/inspector/protocol/Console.json b/Source/JavaScriptCore/inspector/protocol/Console.json >index f3adc8faf69a4ef5157561b34a0f058d83935b19..77325fa59cc126a0f2eb98440d9bfaed14c41e38 100644 >--- a/Source/JavaScriptCore/inspector/protocol/Console.json >+++ b/Source/JavaScriptCore/inspector/protocol/Console.json >@@ -5,7 +5,7 @@ > { > "id": "ChannelSource", > "type": "string", >- "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "content-blocker", "media", "mediasource", "webrtc", "other"], >+ "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "content-blocker", "media", "mediasource", "webrtc", "adclickattribution", "other"], > "description": "Channels for different types of log messages." > }, > { >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generator.py b/Source/JavaScriptCore/inspector/scripts/codegen/generator.py >index 98536bcf286fd6c35a5481bb8d6b27d6a457b8e3..a2019276a438587669f6eac6d6c7a8f021974502 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generator.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generator.py >@@ -55,6 +55,7 @@ _ENUM_IDENTIFIER_RENAME_MAP = { > 'webrtc': 'WebRTC', # Console.ChannelSource.webrtc > 'mediasource': 'MediaSource', # Console.ChannelSource.mediasource > 'webkit': 'WebKit', # CPUProfiler.ThreadInfo.type >+ 'adclickattribution': 'AdClickAttribution', # Console.ChannelSource.adclickattribution > } > > # These objects are built manually by creating and setting JSON::Value instances. >diff --git a/Source/JavaScriptCore/runtime/ConsoleTypes.h b/Source/JavaScriptCore/runtime/ConsoleTypes.h >index 9c409fcea49275ff8fc3c4e41525cb0e5a722cc8..e6faebe9a51fd2f2962ae5454b79d7f60a54ffdb 100644 >--- a/Source/JavaScriptCore/runtime/ConsoleTypes.h >+++ b/Source/JavaScriptCore/runtime/ConsoleTypes.h >@@ -44,6 +44,7 @@ enum class MessageSource : uint8_t { > Media, > WebRTC, > MediaSource, >+ AdClickAttribution, > }; > > enum class MessageType { >@@ -91,7 +92,8 @@ template<> struct EnumTraits<JSC::MessageSource> { > JSC::MessageSource::Other, > JSC::MessageSource::Media, > JSC::MessageSource::WebRTC, >- JSC::MessageSource::MediaSource >+ JSC::MessageSource::MediaSource, >+ JSC::MessageSource::AdClickAttribution > >; > }; > >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 1794bed75a5bd9600331d2520f26b0ec70cd0f21..4f4227a871583ee17be2e5504be8771da69d65db 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -8081,6 +8081,7 @@ static MessageSource messageSourceForWTFLogChannel(const WTFLogChannel& channel) > static const NeverDestroyed<String> mediaChannel = MAKE_STATIC_STRING_IMPL("media"); > static const NeverDestroyed<String> webrtcChannel = MAKE_STATIC_STRING_IMPL("webrtc"); > static const NeverDestroyed<String> mediaSourceChannel = MAKE_STATIC_STRING_IMPL("mediasource"); >+ static const NeverDestroyed<String> adclickattributionSourceChannel = MAKE_STATIC_STRING_IMPL("adclickattribution"); > > if (equalIgnoringASCIICase(mediaChannel, channel.name)) > return MessageSource::Media; >@@ -8091,6 +8092,9 @@ static MessageSource messageSourceForWTFLogChannel(const WTFLogChannel& channel) > if (equalIgnoringASCIICase(mediaSourceChannel, channel.name)) > return MessageSource::MediaSource; > >+ if (equalIgnoringASCIICase(adclickattributionSourceChannel, channel.name)) >+ return MessageSource::AdClickAttribution; >+ > return MessageSource::Other; > } > >diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp >index 41abfe3b7b84b179b6d16df662f2e7ae4bf37d55..1d4e82f18a17a9f23d1fe2fb4fb7d82d8688a48c 100644 >--- a/Source/WebCore/html/HTMLAnchorElement.cpp >+++ b/Source/WebCore/html/HTMLAnchorElement.cpp >@@ -415,36 +415,36 @@ Optional<AdClickAttribution> HTMLAnchorElement::parseAdClickAttribution() const > auto adDestinationAttr = attributeWithoutSynchronization(addestinationAttr); > > if (adCampaignIDAttr.isEmpty() || adDestinationAttr.isEmpty()) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Both adcampaignid and addestination need to be set for Ad Click Attribution to work."_s); >+ document().addConsoleMessage(MessageSource::AdClickAttribution, MessageLevel::Warning, "Both adcampaignid and addestination need to be set for Ad Click Attribution to work."_s); > return WTF::nullopt; > } > > RefPtr<Frame> frame = document().frame(); > if (!frame || !frame->isMainFrame()) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Ad Click Attribution is only supported in the main frame."_s); >+ document().addConsoleMessage(MessageSource::AdClickAttribution, MessageLevel::Warning, "Ad Click Attribution is only supported in the main frame."_s); > return WTF::nullopt; > } > > auto adCampaignID = parseHTMLNonNegativeInteger(adCampaignIDAttr); > if (!adCampaignID) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution."_s); >+ document().addConsoleMessage(MessageSource::AdClickAttribution, MessageLevel::Warning, "adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution."_s); > return WTF::nullopt; > } > > if (adCampaignID.value() > AdClickAttribution::MaxEntropy) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, makeString("adcampaignid must have a non-negative value less than or equal to ", AdClickAttribution::MaxEntropy, " for Ad Click Attribution.")); >+ document().addConsoleMessage(MessageSource::AdClickAttribution, MessageLevel::Warning, makeString("adcampaignid must have a non-negative value less than or equal to ", AdClickAttribution::MaxEntropy, " for Ad Click Attribution.")); > return WTF::nullopt; > } > > URL adDestinationURL { URL(), adDestinationAttr }; > if (!adDestinationURL.isValid() || !adDestinationURL.protocolIsInHTTPFamily()) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "addestination could not be converted to a valid HTTP-family URL."_s); >+ document().addConsoleMessage(MessageSource::AdClickAttribution, MessageLevel::Warning, "addestination could not be converted to a valid HTTP-family URL."_s); > return WTF::nullopt; > } > > RegistrableDomain documentRegistrableDomain { document().url() }; > if (documentRegistrableDomain.matches(adDestinationURL)) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "addestination can not be the same site as the current website."_s); >+ document().addConsoleMessage(MessageSource::AdClickAttribution, MessageLevel::Warning, "addestination can not be the same site as the current website."_s); > return WTF::nullopt; > } > >diff --git a/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp b/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp >index 6eeec0acc42c1da4014bb7e436e09a8e48d03256..1137c93f2275f4389732cc3bb0b150d2eebb0537 100644 >--- a/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp >+++ b/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp >@@ -69,6 +69,7 @@ void PageConsoleAgent::getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Ins > { MAKE_STATIC_STRING_IMPL("WebRTC"), Inspector::Protocol::Console::ChannelSource::WebRTC }, > { MAKE_STATIC_STRING_IMPL("Media"), Inspector::Protocol::Console::ChannelSource::Media }, > { MAKE_STATIC_STRING_IMPL("MediaSource"), Inspector::Protocol::Console::ChannelSource::MediaSource }, >+ { MAKE_STATIC_STRING_IMPL("AdClickAttribution"), Inspector::Protocol::Console::ChannelSource::AdClickAttribution }, > }; > > channels = JSON::ArrayOf<Inspector::Protocol::Console::Channel>::create(); >diff --git a/Source/WebCore/platform/Logging.h b/Source/WebCore/platform/Logging.h >index abf079defa28a34dce806607df56af095cf712ad..0171229bdcd8faf3dc2319b1b0b81d0073f86a8f 100644 >--- a/Source/WebCore/platform/Logging.h >+++ b/Source/WebCore/platform/Logging.h >@@ -38,6 +38,7 @@ namespace WebCore { > #endif > > #define WEBCORE_LOG_CHANNELS(M) \ >+ M(AdClickAttribution) \ > M(Animations) \ > M(ApplePay) \ > M(Archives) \ >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 51a6e858f70ee4b91270c9129cd8c7f1a34c815a..0eaa08157885958195dac1802062030492920864 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -78,6 +78,8 @@ localizedStrings["(uninitialized)"] = "(uninitialized)"; > localizedStrings[", "] = ", "; > localizedStrings["1 match"] = "1 match"; > localizedStrings["2D"] = "2D"; >+localizedStrings["Ad Click Attribution"] = "Ad Click Attribution"; >+localizedStrings["Ad Click Attribution Logging:"] = "Ad Click Attribution Logging:"; > localizedStrings["Accessibility"] = "Accessibility"; > localizedStrings["Action"] = "Action"; > localizedStrings["Activity Viewer"] = "Activity Viewer"; >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js b/Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js >index c2daa3086a0e0823dfda2964337103438ebca3dc..eb1cfbe60c9a73261504fd4884e4002a2634a15a 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js >@@ -174,7 +174,7 @@ WI.ConsoleManager = class ConsoleManager extends WI.Object > if (this._loggingChannelSources.length) > return; > >- this._loggingChannelSources = [WI.ConsoleMessage.MessageSource.Media, WI.ConsoleMessage.MessageSource.WebRTC, WI.ConsoleMessage.MessageSource.MediaSource]; >+ this._loggingChannelSources = [WI.ConsoleMessage.MessageSource.Media, WI.ConsoleMessage.MessageSource.WebRTC, WI.ConsoleMessage.MessageSource.MediaSource, WI.ConsoleMessage.MessageSource.AdClickAttribution]; > > target.ConsoleAgent.getLoggingChannels((error, channels) => { > if (error) >diff --git a/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js b/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js >index 191aa02c379e9701c56fb986d55d2fa1593394b6..39520b6a7bf08828da7ad6dde8f26442ca8e859f 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ConsoleMessage.js >@@ -113,6 +113,7 @@ WI.ConsoleMessage.MessageSource = { > Media: "media", > MediaSource: "mediasource", > WebRTC: "webrtc", >+ AdClickAttribution: "adclickattribution", > }; > > WI.ConsoleMessage.MessageType = { >diff --git a/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js b/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js >index cd0ca56423c07d490c3b389d87e5c88a57d9868a..c37bcb492756c98af2e80f62c497ce99710d1a00 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js >+++ b/Source/WebInspectorUI/UserInterface/Models/IssueMessage.js >@@ -69,6 +69,7 @@ WI.IssueMessage = class IssueMessage extends WI.Object > case "media": > case "mediasource": > case "webrtc": >+ case "adclickattribution": > this._type = WI.IssueMessage.Type.OtherIssue; > break; > >diff --git a/Source/WebInspectorUI/UserInterface/Models/LoggingChannel.js b/Source/WebInspectorUI/UserInterface/Models/LoggingChannel.js >index cbb4f5cdff905b7dd76d26e461b57622b2d92e37..d6fe0fd6cbc8836fc53ee691b1cd7a2f1124ff64 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/LoggingChannel.js >+++ b/Source/WebInspectorUI/UserInterface/Models/LoggingChannel.js >@@ -28,7 +28,7 @@ WI.LoggingChannel = class LoggingChannel > constructor(source, level) > { > console.assert(typeof source === "string"); >- console.assert(source === WI.ConsoleMessage.MessageSource.Media || source === WI.ConsoleMessage.MessageSource.WebRTC || source === WI.ConsoleMessage.MessageSource.MediaSource); >+ console.assert(source === WI.ConsoleMessage.MessageSource.Media || source === WI.ConsoleMessage.MessageSource.WebRTC || source === WI.ConsoleMessage.MessageSource.MediaSource || source === WI.ConsoleMessage.MessageSource.AdClickAttribution); > > console.assert(typeof level === "string"); > console.assert(Object.values(WI.LoggingChannel.Level).includes(level)); >diff --git a/Source/WebInspectorUI/UserInterface/Views/LogContentView.js b/Source/WebInspectorUI/UserInterface/Views/LogContentView.js >index feebd4bbc2038cb350822ac138bfa03c37f0ca31..e3d34f70be5fe4cb6c9ba9e3c1e235ff170887ae 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/LogContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/LogContentView.js >@@ -107,6 +107,7 @@ WI.LogContentView = class LogContentView extends WI.ContentView > new WI.ScopeBarItem(WI.LogContentView.Scopes.Media, WI.UIString("Media"), {className: "media"}), > new WI.ScopeBarItem(WI.LogContentView.Scopes.MediaSource, WI.UIString("MediaSource"), {className: "mediasource"}), > new WI.ScopeBarItem(WI.LogContentView.Scopes.WebRTC, WI.UIString("WebRTC"), {className: "webrtc"}), >+ new WI.ScopeBarItem(WI.LogContentView.Scopes.AdClickAttribution, WI.UIString("Ad Click Attribution"), {className: "adclickattribution"}), > ]; > > this._messageSourceBar = new WI.ScopeBar("message-channel-scope-bar", messageChannelBarItems, messageChannelBarItems[0]); >@@ -402,6 +403,8 @@ WI.LogContentView = class LogContentView extends WI.ContentView > return WI.LogContentView.Scopes.WebRTC; > case WI.ConsoleMessage.MessageSource.MediaSource: > return WI.LogContentView.Scopes.MediaSource; >+ case WI.ConsoleMessage.MessageSource.AdClickAttribution: >+ return WI.LogContentView.Scopes.AdClickAttribution; > } > > return undefined; >@@ -1201,6 +1204,7 @@ WI.LogContentView.Scopes = { > Media: "log-media", > MediaSource: "log-mediasource", > WebRTC: "log-webrtc", >+ AdClickAttribution: "log-adclickattribution", > }; > > WI.LogContentView.ItemWrapperStyleClassName = "console-item"; >diff --git a/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js b/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js >index 08066cd476640c68cca97307a60f9ca3c14213d9..01afb2cf35119b70d12da49d4cbdc740bf146da8 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js >@@ -240,6 +240,7 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi > media: WI.UIString("Media Logging:"), > mediasource: WI.UIString("MSE Logging:"), > webrtc: WI.UIString("WebRTC Logging:"), >+ adclickattribution: WI.UIString("Ad Click Attribution Logging:"), > }; > > let channels = WI.consoleManager.customLoggingChannels; >diff --git a/Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp b/Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp >index 08b00fb9262396fbc41f60441fa507140aa8987b..d8b83d2034f27dbaab0c7d50b5e8ec374023c011 100644 >--- a/Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp >+++ b/Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp >@@ -26,6 +26,7 @@ > #include "config.h" > #include "AdClickAttributionManager.h" > >+#include "Logging.h" > #include <WebCore/FetchOptions.h> > #include <WebCore/FormData.h> > #include <WebCore/ResourceError.h> >@@ -46,7 +47,8 @@ using Conversion = AdClickAttribution::Conversion; > void AdClickAttributionManager::storeUnconverted(AdClickAttribution&& attribution) > { > clearExpired(); >- >+ >+ ALWAYS_LOG(LOGIDENTIFIER, "Storing an ad click from: ", attribution.source().registrableDomain.string(), " to: ", attribution.destination().registrableDomain.string(), "."); > m_unconvertedAdClickAttributionMap.set(std::make_pair(attribution.source(), attribution.destination()), WTFMove(attribution)); > } > >@@ -57,6 +59,8 @@ void AdClickAttributionManager::startTimer(Seconds seconds) > > void AdClickAttributionManager::convert(const Source& source, const Destination& destination, Conversion&& conversion) > { >+ ALWAYS_LOG(LOGIDENTIFIER, "Got a request for conversion for click source: ", source.registrableDomain.string(), " and click destination: ", destination.registrableDomain.string(), " with conversion data: ", conversion.data, " and priority: ", conversion.priority, "."); >+ > clearExpired(); > > if (!conversion.isValid()) >@@ -73,17 +77,21 @@ void AdClickAttributionManager::convert(const Source& source, const Destination& > if (auto optionalSecondsUntilSend = previouslyUnconvertedAttribution.convertAndGetEarliestTimeToSend(WTFMove(conversion))) { > secondsUntilSend = *optionalSecondsUntilSend; > ASSERT(secondsUntilSend != Seconds::infinity()); >+ ALWAYS_LOG(LOGIDENTIFIER, "Converted an ad click for source: ", source.registrableDomain.string(), " and destination: ", destination.registrableDomain.string(), " with conversion data: ", conversion.data, " and priority: ", conversion.priority, "."); > } > // If there is no previously converted attribution for this pair, add the new one. > // If the newly converted attribution has higher priority, replace the old one. > if (previouslyConvertedAttributionIter == m_convertedAdClickAttributionMap.end() >- || previouslyUnconvertedAttribution.hasHigherPriorityThan(previouslyConvertedAttributionIter->value)) >+ || previouslyUnconvertedAttribution.hasHigherPriorityThan(previouslyConvertedAttributionIter->value)) { > m_convertedAdClickAttributionMap.set(pair, WTFMove(previouslyUnconvertedAttribution)); >+ ALWAYS_LOG(LOGIDENTIFIER, "Replaced a previously converted ad click with a new one because it had higher priority."); // FIXME: Split this to be able to have accurate log messages. >+ } > } else if (previouslyConvertedAttributionIter != m_convertedAdClickAttributionMap.end()) { > // If we have no newly converted attribution, re-convert the old one to respect the new priority. > if (auto optionalSecondsUntilSend = previouslyConvertedAttributionIter->value.convertAndGetEarliestTimeToSend(WTFMove(conversion))) { > secondsUntilSend = *optionalSecondsUntilSend; > ASSERT(secondsUntilSend != Seconds::infinity()); >+ ALWAYS_LOG(LOGIDENTIFIER, "Re-converted an ad click for source: ", source.registrableDomain.string(), " and destination: ", destination.registrableDomain.string(), " with conversion data: ", conversion.data, " and priority: ", conversion.priority, "."); > } > } > >@@ -133,6 +141,8 @@ void AdClickAttributionManager::fireConversionRequest(const AdClickAttribution& > loadParameters.mainDocumentURL = WTFMove(conversionReferrerURL); > #endif > >+ ALWAYS_LOG(LOGIDENTIFIER, "About to fire an attribution request for a conversion from click source: ", attribution.source().registrableDomain.string(), " to click destination: ", attribution.destination().registrableDomain.string(), "."); >+ > m_pingLoadFunction(WTFMove(loadParameters), [](const WebCore::ResourceError& error, const WebCore::ResourceResponse& response) { > // FIXME: Add logging of errors to a dedicated channel. > UNUSED_PARAM(response); >@@ -169,8 +179,10 @@ void AdClickAttributionManager::firePendingConversionRequests() > return keyAndValue.value.wasConversionSent(); > }); > >- if (nextTimeToFire < Seconds::infinity()) >+ if (nextTimeToFire < Seconds::infinity()) { >+ ALWAYS_LOG(LOGIDENTIFIER, "Starting timer to fire attribution requests in: ", nextTimeToFire.seconds(), " seconds."); > startTimer(nextTimeToFire); >+ } > } > > void AdClickAttributionManager::clear() >@@ -193,8 +205,12 @@ void AdClickAttributionManager::clearForRegistrableDomain(const RegistrableDomai > > void AdClickAttributionManager::clearExpired() > { >- m_unconvertedAdClickAttributionMap.removeIf([](auto& keyAndValue) { >- return keyAndValue.value.hasExpired(); >+ m_unconvertedAdClickAttributionMap.removeIf([this](auto& keyAndValue) { >+ auto hasExpired = keyAndValue.value.hasExpired(); >+ if (hasExpired) >+ ALWAYS_LOG(LOGIDENTIFIER, "Removing expired ad click from source: ", keyAndValue.value.source().registrableDomain.string(), " to destination: ", keyAndValue.value.destination().registrableDomain.string(), "."); >+ >+ return hasExpired; > }); > } > >@@ -247,4 +263,21 @@ void AdClickAttributionManager::markAllUnconvertedAsExpiredForTesting() > attribution.markAsExpired(); > } > >+#if !RELEASE_LOG_DISABLED >+WTFLogChannel& AdClickAttributionManager::logChannel() const >+{ >+ return WebKit2LogAdClickAttribution; >+} >+ >+const Logger& AdClickAttributionManager::logger() const >+{ >+ return *m_logger; >+} >+ >+bool AdClickAttributionManager::isAlwaysOnLoggingAllowed() const >+{ >+ return m_sessionID.isAlwaysOnLoggingAllowed(); >+} >+#endif >+ > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/AdClickAttributionManager.h b/Source/WebKit/NetworkProcess/AdClickAttributionManager.h >index 250748c058455999e7291b09811cdea7df79db7e..d6ccb98732a13719a9a8cba34cddda347d579f16 100644 >--- a/Source/WebKit/NetworkProcess/AdClickAttributionManager.h >+++ b/Source/WebKit/NetworkProcess/AdClickAttributionManager.h >@@ -33,11 +33,16 @@ > #include <WebCore/Timer.h> > #include <wtf/CompletionHandler.h> > #include <wtf/HashMap.h> >+#include <wtf/LoggerHelper.h> > #include <wtf/text/WTFString.h> > > namespace WebKit { > >-class AdClickAttributionManager { >+class AdClickAttributionManager >+#if !RELEASE_LOG_DISABLED >+ : private LoggerHelper >+#endif >+{ > public: > > using RegistrableDomain = WebCore::RegistrableDomain; >@@ -46,14 +51,23 @@ public: > using Destination = WebCore::AdClickAttribution::Destination; > using Conversion = WebCore::AdClickAttribution::Conversion; > >- AdClickAttributionManager() >+ AdClickAttributionManager(PAL::SessionID sessionID) > : m_firePendingConversionRequestsTimer(*this, &AdClickAttributionManager::firePendingConversionRequests) > , m_pingLoadFunction([](NetworkResourceLoadParameters&& params, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&& completionHandler) { > UNUSED_PARAM(params); > completionHandler(WebCore::ResourceError(), WebCore::ResourceResponse()); > }) >+ , m_sessionID(sessionID) >+#if !RELEASE_LOG_DISABLED >+ , m_logger(Logger::create(this)) >+ , m_logIdentifier(uniqueLogIdentifier()) > { >+ m_logger->setEnabled(this, isAlwaysOnLoggingAllowed()); > } >+#else >+ { >+ } >+#endif > > void storeUnconverted(AdClickAttribution&&); > void convert(const Source&, const Destination&, Conversion&&); >@@ -71,12 +85,25 @@ private: > void firePendingConversionRequests(); > void clearExpired(); > >+#if !RELEASE_LOG_DISABLED >+ const Logger& logger() const final; >+ const void* logIdentifier() const final { return m_logIdentifier; } >+ const char* logClassName() const override { return "AdClickAttributionManager"; } >+ WTFLogChannel& logChannel() const final; >+ bool isAlwaysOnLoggingAllowed() const; >+#endif >+ > HashMap<std::pair<Source, Destination>, AdClickAttribution> m_unconvertedAdClickAttributionMap; > HashMap<std::pair<Source, Destination>, AdClickAttribution> m_convertedAdClickAttributionMap; > WebCore::Timer m_firePendingConversionRequestsTimer; > Function<void(NetworkResourceLoadParameters&&, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&&)> m_pingLoadFunction; > bool m_isRunningTest { false }; > Optional<URL> m_conversionBaseURLForTesting; >+ PAL::SessionID m_sessionID; >+#if !RELEASE_LOG_DISABLED >+ mutable RefPtr<Logger> m_logger; >+ const void* m_logIdentifier; >+#endif > }; > > } // namespace WebKit >diff --git a/Source/WebKit/NetworkProcess/NetworkSession.cpp b/Source/WebKit/NetworkProcess/NetworkSession.cpp >index 5b442bf282f15cb2e99bb28490772f08fdb97141..f01c41f99479f77e87dedf7802a82653383b970c 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSession.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSession.cpp >@@ -74,7 +74,7 @@ NetworkStorageSession& NetworkSession::networkStorageSession() const > NetworkSession::NetworkSession(NetworkProcess& networkProcess, PAL::SessionID sessionID) > : m_sessionID(sessionID) > , m_networkProcess(networkProcess) >- , m_adClickAttribution(makeUniqueRef<AdClickAttributionManager>()) >+ , m_adClickAttribution(makeUniqueRef<AdClickAttributionManager>(sessionID)) > { > m_adClickAttribution->setPingLoadFunction([this, weakThis = makeWeakPtr(this)](NetworkResourceLoadParameters&& loadParameters, CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&& completionHandler) { > if (!weakThis) >diff --git a/Source/WebKit/Platform/Logging.h b/Source/WebKit/Platform/Logging.h >index 4c5cc67441f2b01ba49eadab4d41f3e9081f897d..9d5a42d34f02dd29accca043614ab89cd0d1afb6 100644 >--- a/Source/WebKit/Platform/Logging.h >+++ b/Source/WebKit/Platform/Logging.h >@@ -40,6 +40,7 @@ extern "C" { > #endif > > #define WEBKIT2_LOG_CHANNELS(M) \ >+ M(AdClickAttribution) \ > M(Automation) \ > M(ActivityState) \ > M(BackForward) \ >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >index aac8715664f2cbe7ce70df27463ec4f175d82c79..52189d3c6afefb99db50d632c4697883e904e2a9 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >@@ -124,6 +124,7 @@ NSString *WebConsoleMessageOtherMessageSource = @"OtherMessageSource"; > NSString *WebConsoleMessageMediaMessageSource = @"MediaMessageSource"; > NSString *WebConsoleMessageWebRTCMessageSource = @"WebRTCMessageSource"; > NSString *WebConsoleMessageMediaSourceMessageSource = @"MediaSourceMessageSource"; >+NSString *WebConsoleMessageAdClickAttributionMessageSource = @"AdClickAttributionMessageSource"; > > NSString *WebConsoleMessageDebugMessageLevel = @"DebugMessageLevel"; > NSString *WebConsoleMessageLogMessageLevel = @"LogMessageLevel"; >@@ -401,6 +402,8 @@ inline static NSString *stringForMessageSource(MessageSource source) > return WebConsoleMessageWebRTCMessageSource; > case MessageSource::MediaSource: > return WebConsoleMessageMediaSourceMessageSource; >+ case MessageSource::AdClickAttribution: >+ return WebConsoleMessageAdClickAttributionMessageSource; > } > ASSERT_NOT_REACHED(); > return @"";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197332
:
368365
|
368371
|
368375
|
368386
|
368509
|
368576
|
368585
|
368588
|
368589
|
368645