DescriptionRefactor about:sync's events framework
This CL changes the way we implement event callbacks on the sync
internals debug page. We plan to rely more on this framwork in the
future. This CL ensures we'll be building on a solid foundation.
It replaces chrome_sync.js's custom event listener implementation with
EventTarget from Chrome's internal JavaScript libraries. Sync doesn't
require anything special in its implementation of event callbacks, so it
makes sense to use shared code for this.
Rather than defining a set of event listener callbacks, all events are
now routed through a single chrome.sync.events EventTarget. From the
listener's point of view, this doesn't change much, since they still
need to register for a specific event type. However, it does mean that
chrome_sync.js no longer needs to be aware of all the possible event
types. Many of the event definitions have been moved into sync_log.js.
This change also introduces a new chrome.sync.handleEvent function to be
called from the C++ layer. This new scheme will fail a bit more
gracefully than the old system would if the C++ and JavaScript list of
event definitions ever got out of sync.
Finally, this CL adds some more tests for the 'event log' tab of
about:sync. This helps to ensure that the new system doesn't break
any existing functionality.
BUG=328606
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250835
Patch Set 1 #
Total comments: 34
Patch Set 2 : Review fixes #Patch Set 3 : Fix test assertions #
Total comments: 10
Patch Set 4 : More fixes from review #
Total comments: 2
Patch Set 5 : Add semicolons #
Messages
Total messages: 16 (0 generated)
|