DescriptionFactor out a PendingNotificationTracker from the NotificationManager.
The existing code ends up moving values between threads, whether by
value or hidden in a callback, causing instability and races in edge-
cases, for example when abruptly cancelling the load.
This patch introduces a PendingNotificationTracker, which completely
lives on the same thread as NotificationManager and will store all
information associated with the notification, ensuring that it never
inadvertently leaves the thread.
The NotificationImageLoader lives on the main thread and is in charge
of doing the actual fetch. Rather than storing either a callback with
the Notification's data, it knows a pending notification id given to
it by the PendingNotificationTracker. This allows us to re-associate
the data when the fetched resource(s) are available.
I'm adding some layout tests in the following patch to exercise the
image loader in a number of additional cases. Unit tests will be added
in a follow-up patch.
https://codereview.chromium.org/933153003/
BUG=458640
Committed: https://crrev.com/11d160807115e28b7b870a40a2ab14825f7cd365
Cr-Commit-Position: refs/heads/master@{#316921}
Patch Set 1 #
Total comments: 27
Patch Set 2 : comments #Patch Set 3 : #Patch Set 4 : #
Total comments: 2
Patch Set 5 : further comments #Patch Set 6 : #
Total comments: 9
Patch Set 7 : #
Messages
Total messages: 14 (3 generated)
|