⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 270598 in webkit


Ignore:
Timestamp:
Dec 9, 2020, 1:24:40 PM (6 years ago)
Author:
wilander@apple.com
Message:

PCM: Make JSON key names use underscores according to the W3C conversation
https://bugs.webkit.org/show_bug.cgi?id=219696
<rdar://problem/72143642>

Reviewed by Brent Fulgham.

Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
concluded that the JSON report should use underscores in its keys instead of dashes.
This patch makes that change and shortens the "report_version" key to just "version".

Source/WebCore:

Existing tests updated.

  • loader/PrivateClickMeasurement.cpp:

(WebCore::PrivateClickMeasurement::json const):

Tools:

  • TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:

(TestWebKitAPI::TEST):

LayoutTests:

  • http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt:
  • http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r270590 r270598  
     12020-12-09  John Wilander  <wilander@apple.com>
     2
     3        PCM: Make JSON key names use underscores according to the W3C conversation
     4        https://bugs.webkit.org/show_bug.cgi?id=219696
     5        <rdar://problem/72143642>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
     10        concluded that the JSON report should use underscores in its keys instead of dashes.
     11        This patch makes that change and shortens the "report_version" key to just "version".
     12
     13        * http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt:
     14        * http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:
     15
    1162020-12-09  Antti Koivisto  <antti@apple.com>
    217
  • trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start-expected.txt

    r270136 r270598  
    1212No cookies in attribution request.
    1313Request body:
    14 {"source-engagement-type":"click","source-site":"127.0.0.1","source-id":3,"attributed-on-site":"localhost","trigger-data":12,"report-version":1}
     14{"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":1}
    1515
    1616
  • trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt

    r270136 r270598  
    1717No cookies in attribution request.
    1818Request body:
    19 {"source-engagement-type":"click","source-site":"127.0.0.1","source-id":3,"attributed-on-site":"localhost","trigger-data":12,"report-version":1}
     19{"source_engagement_type":"click","source_site":"127.0.0.1","source_id":3,"attributed_on_site":"localhost","trigger_data":12,"version":1}
    2020
    2121
  • trunk/Source/WebCore/ChangeLog

    r270597 r270598  
     12020-12-09  John Wilander  <wilander@apple.com>
     2
     3        PCM: Make JSON key names use underscores according to the W3C conversation
     4        https://bugs.webkit.org/show_bug.cgi?id=219696
     5        <rdar://problem/72143642>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
     10        concluded that the JSON report should use underscores in its keys instead of dashes.
     11        This patch makes that change and shortens the "report_version" key to just "version".
     12
     13        Existing tests updated.
     14
     15        * loader/PrivateClickMeasurement.cpp:
     16        (WebCore::PrivateClickMeasurement::json const):
     17
    1182020-12-09  Antoine Quint  <graouts@webkit.org>
    219
  • trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp

    r270456 r270598  
    161161        return reportDetails;
    162162
    163     reportDetails->setString("source-engagement-type"_s, "click"_s);
    164     reportDetails->setString("source-site"_s, m_sourceSite.registrableDomain.string());
    165     reportDetails->setInteger("source-id"_s, m_sourceID.id);
    166     reportDetails->setString("attributed-on-site"_s, m_attributeOnSite.registrableDomain.string());
    167     reportDetails->setInteger("trigger-data"_s, m_attributionTriggerData->data);
    168     reportDetails->setInteger("report-version"_s, 1);
     163    reportDetails->setString("source_engagement_type"_s, "click"_s);
     164    reportDetails->setString("source_site"_s, m_sourceSite.registrableDomain.string());
     165    reportDetails->setInteger("source_id"_s, m_sourceID.id);
     166    reportDetails->setString("attributed_on_site"_s, m_attributeOnSite.registrableDomain.string());
     167    reportDetails->setInteger("trigger_data"_s, m_attributionTriggerData->data);
     168    reportDetails->setInteger("version"_s, 1);
    169169    return reportDetails;
    170170}
  • trunk/Tools/ChangeLog

    r270592 r270598  
     12020-12-09  John Wilander  <wilander@apple.com>
     2
     3        PCM: Make JSON key names use underscores according to the W3C conversation
     4        https://bugs.webkit.org/show_bug.cgi?id=219696
     5        <rdar://problem/72143642>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Further discussion in https://github.com/privacycg/private-click-measurement/issues/30
     10        concluded that the JSON report should use underscores in its keys instead of dashes.
     11        This patch makes that change and shortens the "report_version" key to just "version".
     12
     13        * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
     14        (TestWebKitAPI::TEST):
     15
    1162020-12-09  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp

    r270456 r270598  
    5151    ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");
    5252
    53     ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":0,\"attributed-on-site\":\"example.com\",\"trigger-data\":0,\"report-version\":1}");
     53    ASSERT_EQ(attribution.json()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":0,\"attributed_on_site\":\"example.com\",\"trigger_data\":0,\"version\":1}");
    5454}
    5555
     
    6363    ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");
    6464
    65     ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":192,\"attributed-on-site\":\"example.com\",\"trigger-data\":9,\"report-version\":1}");
     65    ASSERT_EQ(attribution.json()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":192,\"attributed_on_site\":\"example.com\",\"trigger_data\":9,\"version\":1}");
    6666}
    6767
     
    7575    ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");
    7676
    77     ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":255,\"attributed-on-site\":\"example.com\",\"trigger-data\":15,\"report-version\":1}");
     77    ASSERT_EQ(attribution.json()->toJSONString(), "{\"source_engagement_type\":\"click\",\"source_site\":\"webkit.org\",\"source_id\":255,\"attributed_on_site\":\"example.com\",\"trigger_data\":15,\"version\":1}");
    7878}
    7979
Note: See TracChangeset for help on using the changeset viewer.