• Evan Stade's avatar
    Mash notifications: fix handling of out-of-order Display/Close pairs. · 661500f0
    Evan Stade authored
    The linked bug uncovered a case where ShowClientNotification was called
    multiple times with the same notification (i.e. the same notification
    ID) on the Chrome side, while Ash sent a HandleNotificationClosed
    for the first shown notification which arrived in Chrome after the
    second ShowClientNotification. Then Ash subsequently sent a second
    HandleNotificationClosed, but since the notification had already been
    removed from the Chrome-side cache in response to the first
    HandleNotificationClosed, an error was thrown (specifically, the check
    in NotificationPlatformBridgeChromeOs::HandleNotificationClosed()).
    
    The solution is to create a token that is separate from the
    notification's ID to identify the Display call to which the Close is
    paired. This token is not used for other callbacks, such as the button
    handlers, because then Chrome could drop user input that occurred around
    the same time as a notification being updated (seems fairly likely for
    any notification that has a progress bar, such as downloads).
    
    Bug: 825141
    Change-Id: I01f66dcc1107bfa7337c447780edb897e24498e6
    Reviewed-on: https://chromium-review.googlesource.com/979268
    Commit-Queue: Evan Stade <estade@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
    Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#548484}
    661500f0
ash_message_center_controller.mojom 3.42 KB