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

Changeset 276545 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 5:47:50 PM (5 years ago)
Author:
Kate Cheney
Message:

PCM: debug mode should send the second report on a 10 second delay after the first
https://bugs.webkit.org/show_bug.cgi?id=225010
<rdar://problem/77092303>

Reviewed by John Wilander.

Fix a bug in PCM debug mode where we don't set the timer for 10_s
after sending the first report for an attribution.

No new tests, this is debug mode only. Non-debug mode behavior is
covered by existing tests, and I tested debug mode manually.

  • NetworkProcess/PrivateClickMeasurementManager.cpp:

(WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
If the attribution has been sent to only one endpoint, indicated by
a non-null laterTimeToSend value, we should set the timer to be 10
seconds if debug mode is enabled.

Also, change the interval time from 1 minute to 10 seconds, because
there was no good reason that it was 1 minute and we should be
consistent. Also 1 minute is a long time to wait during a test.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r276523 r276545  
     12021-04-23  Kate Cheney  <katherine_cheney@apple.com>
     2
     3        PCM: debug mode should send the second report on a 10 second delay after the first
     4        https://bugs.webkit.org/show_bug.cgi?id=225010
     5        <rdar://problem/77092303>
     6
     7        Reviewed by John Wilander.
     8
     9        Fix a bug in PCM debug mode where we don't set the timer for 10_s
     10        after sending the first report for an attribution.
     11
     12        No new tests, this is debug mode only. Non-debug mode behavior is
     13        covered by existing tests, and I tested debug mode manually.
     14
     15        * NetworkProcess/PrivateClickMeasurementManager.cpp:
     16        (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
     17        If the attribution has been sent to only one endpoint, indicated by
     18        a non-null laterTimeToSend value, we should set the timer to be 10
     19        seconds if debug mode is enabled.
     20
     21        Also, change the interval time from 1 minute to 10 seconds, because
     22        there was no good reason that it was 1 minute and we should be
     23        consistent. Also 1 minute is a long time to wait during a test.
     24
    1252021-04-23  Commit Queue  <commit-queue@webkit.org>
    226
  • trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp

    r276413 r276545  
    396396                    // We've already sent an attribution this round. We should send additional overdue attributions at
    397397                    // a random time between 15 and 30 minutes to avoid a burst of simultaneous attributions. If debug
    398                     // mode is enabled, this should be every minute for easy testing.
    399                     auto interval = debugModeEnabled() ? 1_min : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
     398                    // mode is enabled, this should be much shorter for easy testing.
     399                    auto interval = debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
    400400                    startTimer(interval);
    401401                    return;
     
    408408
    409409                // Update nextTimeToFire in case the later report time for this attribution is sooner than the scheduled next time to fire.
     410                // Or, if debug mode is enabled, we should send the second report on a much shorter delay for easy testing.
    410411                if (laterTimeToSend)
    411                     nextTimeToFire = std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
     412                    nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
    412413
    413414                continue;
Note: See TracChangeset for help on using the changeset viewer.