Changeset 232585 in webkit


Ignore:
Timestamp:
Jun 7, 2018 10:05:08 AM (6 years ago)
Author:
Brent Fulgham
Message:

Remove unused debug mode conditions
https://bugs.webkit.org/show_bug.cgi?id=186358
<rdar://problem/39117121>

Reviewed by Zalan Bujtas.

Source/WebKit:

Remove some unused code paths related to ResourceLoadStatistics debug mode.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):

LayoutTests:

Rebase test expectations after behavior change.

  • http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt:
  • http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
  • http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
  • http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
  • http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
  • http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
  • http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction-expected.txt:
  • http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
  • http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction-expected.txt
  • http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r232584 r232585  
     12018-06-07  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Remove unused debug mode conditions
     4        https://bugs.webkit.org/show_bug.cgi?id=186358
     5        <rdar://problem/39117121>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Rebase test expectations after behavior change.
     10
     11        * http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt:
     12        * http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
     13        * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
     14        * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
     15        * http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
     16        * http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
     17        * http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction-expected.txt:
     18        * http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
     19        * http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction-expected.txt
     20        * http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html
     21
    1222018-06-07  Brent Fulgham  <bfulgham@apple.com>
    223
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt

    r231450 r232585  
    2929Frame: '<!--frame4-->'
    3030--------
    31 After user interaction, should receive one non-partitioned, first party cookie.
    32 Received cookie named 'firstPartyCookie'.
    33 Did not receive cookie named 'partitionedCookie'.
    34 Client-side document.cookie: firstPartyCookie=value
     31After user interaction, should still only receive one partitioned, third party cookie.
     32Did not receive cookie named 'firstPartyCookie'.
     33Received cookie named 'partitionedCookie'.
     34Client-side document.cookie: partitionedCookie=value
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html

    r227943 r232585  
    7777            case "#step6":
    7878                // Load localhost under 127.0.0.1 and check that it gets its non-partitioned cookie after user interaction.
    79                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should receive one non-partitioned, first party cookie.", finishTest);
     79                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should still only receive one partitioned, third party cookie.", finishTest);
    8080                break;
    8181        }
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt

    r231450 r232585  
    2929Frame: '<!--frame4-->'
    3030--------
    31 After first user interaction, should only receive un-partitioned cookie.
    32 Received cookie named 'firstPartyCookie'.
    33 Did not receive cookie named 'thirdPartyCookie'.
    34 Client-side document.cookie: firstPartyCookie=value
     31After first user interaction, should still only receive a partitioned, third-party cookie.
     32Did not receive cookie named 'firstPartyCookie'.
     33Received cookie named 'thirdPartyCookie'.
     34Client-side document.cookie: thirdPartyCookie=value
    3535
    3636--------
     
    4545Frame: '<!--frame6-->'
    4646--------
    47 After second user interaction, should only receive un-partitioned cookie.
    48 Received cookie named 'firstPartyCookie'.
    49 Did not receive cookie named 'thirdPartyCookie'.
    50 Client-side document.cookie: firstPartyCookie=value
     47After second user interaction, should still only receive a partitioned, third-party cookie.
     48Did not receive cookie named 'firstPartyCookie'.
     49Received cookie named 'thirdPartyCookie'.
     50Client-side document.cookie: thirdPartyCookie=value
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html

    r229152 r232585  
    8484                // http://localhost:8000 now has user interaction, check that un-partitioned cookie is sent for third-party
    8585                document.location.hash = "step6";
    86                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After first user interaction, should only receive un-partitioned cookie.",
     86                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After first user interaction, should still only receive a partitioned, third-party cookie.",
    8787                    setShortCookiePartitioningTimeOutPlusFireShouldPartitionCookiesHandlerAndContinue);
    8888                break;
     
    9595            case "#step7":
    9696                // http://localhost:8000 now has fresh user interaction, check that un-partitioned cookie is sent for third-party
    97                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After second user interaction, should only receive un-partitioned cookie.",
     97                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After second user interaction, should still only receive a partitioned, third-party cookie.",
    9898                    finishTest);
    9999                break;
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt

    r231450 r232585  
    2929Frame: '<!--frame4-->'
    3030--------
    31 After user interaction, should only receive non-partitioned, first party cookie.
    32 Received cookie named 'firstPartyCookie'.
    33 Did not receive cookie named 'thirdPartyCookie'.
    34 Client-side document.cookie: firstPartyCookie=value
     31After user interaction, should still only receive a partitioned, third-party cookie.
     32Did not receive cookie named 'firstPartyCookie'.
     33Received cookie named 'thirdPartyCookie'.
     34Client-side document.cookie: thirdPartyCookie=value
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html

    r229152 r232585  
    6666                break;
    6767            case "#step5":
    68                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should only receive non-partitioned, first party cookie.", finishTest);
     68                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should still only receive a partitioned, third-party cookie.", finishTest);
    6969                break;
    7070        }
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction-expected.txt

    r231450 r232585  
    3737Frame: '<!--frame5-->'
    3838--------
    39 After user interaction, should receive non-partitioned cookies set in a first-party context and in a third-party context.
    40 Received cookie named 'firstPartyCookie'.
    41 Received cookie named 'thirdPartyCookie'.
    42 Did not receive cookie named 'partitionedThirdPartyCookie'.
    43 Client-side document.cookie: firstPartyCookie=value,thirdPartyCookie=value
     39After user interaction, should should still only receive a partitioned, third-party cookie.
     40Did not receive cookie named 'firstPartyCookie'.
     41Did not receive cookie named 'thirdPartyCookie'.
     42Received cookie named 'partitionedThirdPartyCookie'.
     43Client-side document.cookie: partitionedThirdPartyCookie=value
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html

    r227943 r232585  
    8282                break;
    8383            case "#step7":
    84                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should receive non-partitioned cookies set in a first-party context and in a third-party context.", finishTest);
     84                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=After user interaction, should should still only receive a partitioned, third-party cookie.", finishTest);
    8585                break;
    8686        }
  • trunk/LayoutTests/http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction-expected.txt

    r226235 r232585  
    44
    55
    6 PASS Has storage access. document.cookie == , cookies seen server-side == "No cookies"
     6PASS No storage access. document.cookie == , cookies seen server-side == "No cookies"
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html

    r226016 r232585  
    3232</head>
    3333<body>
    34 <iframe sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-modals" id="theIframe" src="http://localhost:8000/storageAccess/resources/has-storage-access-iframe.html#policyShouldGrantAccess"></iframe>
     34<iframe sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-modals" id="theIframe" src="http://localhost:8000/storageAccess/resources/has-storage-access-iframe.html#policyShouldNotGrantAccess"></iframe>
    3535</body>
    3636</html>
  • trunk/Source/WebKit/ChangeLog

    r232576 r232585  
     12018-06-07  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Remove unused debug mode conditions
     4        https://bugs.webkit.org/show_bug.cgi?id=186358
     5        <rdar://problem/39117121>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Remove some unused code paths related to ResourceLoadStatistics debug mode.
     10
     11        * UIProcess/WebResourceLoadStatisticsStore.cpp:
     12        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
     13        (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
     14
    1152018-06-07  Dan Bernstein  <mitz@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp

    r231684 r232585  
    557557        statistics.mostRecentUserInteractionTime = WallTime::now();
    558558
    559         if (m_debugModeEnabled) {
    560             if (statistics.isMarkedForCookieBlocking)
    561                 updateCookiePartitioningForDomains({ primaryDomain }, { }, { }, ShouldClearFirst::No, []() { });
    562         } else
    563             if (statistics.isMarkedForCookiePartitioning || statistics.isMarkedForCookieBlocking)
    564                 updateCookiePartitioningForDomains({ }, { }, { primaryDomain }, ShouldClearFirst::No, []() { });
     559        if (statistics.isMarkedForCookieBlocking)
     560            updateCookiePartitioningForDomains({ primaryDomain }, { }, { }, ShouldClearFirst::No, []() { });
    565561    });
    566562}
     
    10581054bool WebResourceLoadStatisticsStore::shouldPartitionCookies(const ResourceLoadStatistics& statistic) const
    10591055{
    1060     if (m_debugModeEnabled)
    1061         return statistic.isPrevalentResource && statistic.hadUserInteraction;
    1062 
    1063     return statistic.isPrevalentResource && statistic.hadUserInteraction && WallTime::now() > statistic.mostRecentUserInteractionTime + m_parameters.timeToLiveCookiePartitionFree;
     1056    return statistic.isPrevalentResource && statistic.hadUserInteraction;
    10641057}
    10651058
Note: See TracChangeset for help on using the changeset viewer.