RESOLVED FIXED 237969
Implement PCM to SKAdNetwork bridge
https://bugs.webkit.org/show_bug.cgi?id=237969
Summary Implement PCM to SKAdNetwork bridge
Alex Christensen
Reported 2022-03-16 10:40:37 PDT
Implement PCM to SKAdNetwork bridge
Attachments
Patch (36.72 KB, patch)
2022-03-16 10:47 PDT, Alex Christensen
no flags
Patch (35.10 KB, patch)
2022-03-16 14:05 PDT, Alex Christensen
no flags
Patch (37.17 KB, patch)
2022-03-22 16:07 PDT, Alex Christensen
ews-feeder: commit-queue-
Alex Christensen
Comment 1 2022-03-16 10:47:25 PDT
Alex Christensen
Comment 2 2022-03-16 14:05:40 PDT
John Wilander
Comment 3 2022-03-21 20:35:54 PDT
Comment on attachment 454891 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454891&action=review r=me with comments. Please make sure the WK2 bots are green before landing. > Source/WTF/wtf/PlatformHave.h:1227 > +#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000) I think this should be TBD. > Source/WebKit/ChangeLog:8 > + Please add some comments on the changes in the WebKit layer. > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1822 > +void NetworkSessionCocoa::donateToSKAdNetwork(WebCore::PrivateClickMeasurement&& pcm) This method doesn't move the pcm object further. Would it make sense to use & const instead? > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1826 > + config.get().appAdamId = @(*pcm.adamID()); I think we should check that there is an adamID and if not, broadcast an error message and return without forwarding to the daemon. See my comment further down on isSKAdNetworkAttribution(). > Source/WebKit/UIProcess/WebPageProxy.cpp:4982 > + if (privateClickMeasurement->destinationSite().matches(frame->url()) || privateClickMeasurement->adamID()) Since we use it this way, I'd prefer a convenience function isSKAdNetworkAttribution() which internally checks whether it is a valid such PCM object. > Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:599 > + EXPECT_WK_STREQ(consoleMessages[1], "Submitting potential install attribution for AdamId: 1234567890, adNetworkRegistrableDomain: destination, impressionId: MTIzNDU2Nzg5MDEyMzQ1Ng, sourceWebRegistrableDomain: example.com, version: 3"); Huh, I didn't know you could test console messages. Neat.
Alex Christensen
Comment 4 2022-03-22 16:07:15 PDT
Alex Christensen
Comment 5 2022-03-22 16:09:10 PDT
(In reply to John Wilander from comment #3) > This method doesn't move the pcm object further. Would it make sense to use > & const instead? It is consuming the pcm, so although it doesn't call a move constructor or anything, I think move semantics is conceptually how we should be thinking about the pcm that is moved here and we shouldn't do anything with it afterwards. > Since we use it this way, I'd prefer a convenience function > isSKAdNetworkAttribution() which internally checks whether it is a valid > such PCM object. Good idea. Better name for the same thing. > > Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:599 > > + EXPECT_WK_STREQ(consoleMessages[1], "Submitting potential install attribution for AdamId: 1234567890, adNetworkRegistrableDomain: destination, impressionId: MTIzNDU2Nzg5MDEyMzQ1Ng, sourceWebRegistrableDomain: example.com, version: 3"); > > Huh, I didn't know you could test console messages. Neat. You can on macOS
Alex Christensen
Comment 6 2022-03-22 22:26:21 PDT
Note You need to log in before you can comment on or make changes to this bug.