Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Issue 160083002: Refactor about:sync's events framework (Closed)

Created:
6 years, 10 months ago by rlarocque
Modified:
6 years, 10 months ago
Reviewers:
Dan Beam
CC:
chromium-reviews, arv+watch_chromium.org, Nicolas Zea
Visibility:
Public.

Description

Refactor 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+270 lines, -186 lines) Patch
M chrome/browser/resources/sync_internals/about.js View 1 2 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/resources/sync_internals/chrome_sync.js View 1 2 3 4 1 chunk +83 lines, -163 lines 0 comments Download
M chrome/browser/resources/sync_internals/notifications.js View 1 chunk +8 lines, -4 lines 0 comments Download
M chrome/browser/resources/sync_internals/sync_log.js View 1 2 3 2 chunks +42 lines, -10 lines 0 comments Download
M chrome/browser/resources/sync_internals/sync_search.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/sync_internals_browsertest.js View 1 2 3 4 chunks +125 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/sync_internals_message_handler.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
rlarocque
Please review. A bit of background: I'm no JS expert, but some parts of the ...
6 years, 10 months ago (2014-02-11 22:09:02 UTC) #1
Dan Beam
https://codereview.chromium.org/160083002/diff/1/chrome/browser/resources/sync_internals/about.js File chrome/browser/resources/sync_internals/about.js (right): https://codereview.chromium.org/160083002/diff/1/chrome/browser/resources/sync_internals/about.js#newcode80 chrome/browser/resources/sync_internals/about.js:80: chrome.sync.removeEventListener( should this be chrome.sync.events.removeEventListener? https://codereview.chromium.org/160083002/diff/1/chrome/browser/resources/sync_internals/chrome_sync.js File chrome/browser/resources/sync_internals/chrome_sync.js (right): ...
6 years, 10 months ago (2014-02-11 23:21:48 UTC) #2
rlarocque
Addressed most comments. PTAL. https://codereview.chromium.org/160083002/diff/1/chrome/browser/resources/sync_internals/about.js File chrome/browser/resources/sync_internals/about.js (right): https://codereview.chromium.org/160083002/diff/1/chrome/browser/resources/sync_internals/about.js#newcode80 chrome/browser/resources/sync_internals/about.js:80: chrome.sync.removeEventListener( On 2014/02/11 23:21:48, Dan ...
6 years, 10 months ago (2014-02-12 00:39:55 UTC) #3
Dan Beam
https://codereview.chromium.org/160083002/diff/1/chrome/browser/ui/webui/sync_internals_browsertest.js File chrome/browser/ui/webui/sync_internals_browsertest.js (right): https://codereview.chromium.org/160083002/diff/1/chrome/browser/ui/webui/sync_internals_browsertest.js#newcode264 chrome/browser/ui/webui/sync_internals_browsertest.js:264: assertLE(4, firstRow.children.length); shouldn't this be assertGE(), btw? https://codereview.chromium.org/160083002/diff/1/chrome/browser/ui/webui/sync_internals_browsertest.js#newcode269 chrome/browser/ui/webui/sync_internals_browsertest.js:269: ...
6 years, 10 months ago (2014-02-12 00:46:19 UTC) #4
rlarocque
Patch updated. https://codereview.chromium.org/160083002/diff/1/chrome/browser/ui/webui/sync_internals_browsertest.js File chrome/browser/ui/webui/sync_internals_browsertest.js (right): https://codereview.chromium.org/160083002/diff/1/chrome/browser/ui/webui/sync_internals_browsertest.js#newcode264 chrome/browser/ui/webui/sync_internals_browsertest.js:264: assertLE(4, firstRow.children.length); On 2014/02/12 00:46:19, Dan Beam ...
6 years, 10 months ago (2014-02-12 01:00:45 UTC) #5
Dan Beam
lgtm https://codereview.chromium.org/160083002/diff/210001/chrome/browser/resources/sync_internals/chrome_sync.js File chrome/browser/resources/sync_internals/chrome_sync.js (right): https://codereview.chromium.org/160083002/diff/210001/chrome/browser/resources/sync_internals/chrome_sync.js#newcode71 chrome/browser/resources/sync_internals/chrome_sync.js:71: get elapsedSeconds() { nit: getters should be cheap, ...
6 years, 10 months ago (2014-02-12 01:24:59 UTC) #6
rlarocque
Thanks for the quick and thorough reviews. I learned a lot from your comments. I've ...
6 years, 10 months ago (2014-02-12 02:07:38 UTC) #7
Dan Beam
slgtm, just FYI https://codereview.chromium.org/160083002/diff/280001/chrome/browser/resources/sync_internals/chrome_sync.js File chrome/browser/resources/sync_internals/chrome_sync.js (right): https://codereview.chromium.org/160083002/diff/280001/chrome/browser/resources/sync_internals/chrome_sync.js#newcode79 chrome/browser/resources/sync_internals/chrome_sync.js:79: } nit: whenever you say var ...
6 years, 10 months ago (2014-02-12 03:27:32 UTC) #8
rlarocque
On 2014/02/12 03:27:32, Dan Beam wrote: > slgtm, just FYI > > https://codereview.chromium.org/160083002/diff/280001/chrome/browser/resources/sync_internals/chrome_sync.js > File ...
6 years, 10 months ago (2014-02-12 18:32:06 UTC) #9
rlarocque
The CQ bit was checked by rlarocque@chromium.org
6 years, 10 months ago (2014-02-12 18:33:10 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/160083002/240002
6 years, 10 months ago (2014-02-12 18:35:38 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-12 19:07:16 UTC) #12
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) base_unittests, browser_tests, interactive_ui_tests, net_unittests, unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=262632
6 years, 10 months ago (2014-02-12 19:07:17 UTC) #13
rlarocque
The CQ bit was checked by rlarocque@chromium.org
6 years, 10 months ago (2014-02-12 19:23:16 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/160083002/240002
6 years, 10 months ago (2014-02-12 19:26:39 UTC) #15
commit-bot: I haz the power
6 years, 10 months ago (2014-02-12 23:24:53 UTC) #16
Message was sent while issue was closed.
Change committed as 250835

Powered by Google App Engine
This is Rietveld 408576698