• Hesen Zhang's avatar
    notification scheduler: Custom throttle layer implementation. · 1af86888
    Hesen Zhang authored
    Enable client to customize config related to throttling - mainly
    suppression duration and number of negative action count threshold
    from client side API -
     std::unique_ptr<ThrottleConfig> GetThrottleConfig() {...}
    
    This API will give client the option to override the fields related to
    throttling in global config.
    
    Internally a Delegate of ImpressionHistoryTracker will be created, and
    the glue layer NotificationScheduler delegates this request.
    
    Cleaned up throttled related parameters from schedule_params, and
    impression struct and proto.
    
    Some task need to do:
    - Check consecutive negative actions instead of dismiss actions only.
    - Need to write more detailed unit test to go through whole flow.
    - May consider adding other way (positive impression - release throttle)
    - Apply this layer to current existing clients including a more
    functional web_ui for better test and play purpose.
    
    
    Bug: 1053659
    Change-Id: I3c767bd2be9259e74926a83ef5231ab1940b3972
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063253
    Commit-Queue: Hesen Zhang <hesen@chromium.org>
    Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#744409}
    1af86888
notification_scheduler_unittest.cc 16 KB