| .. | | - | - |
| engine/ | | 03-May-2024 | - | 22,723 | 16,431 |
| glue/ | | 03-May-2024 | - | 22,049 | 15,783 |
| notifier/ | | 03-May-2024 | - | 3,602 | 2,549 |
| protocol/ | | 03-May-2024 | - | 2,126 | 1,693 |
| resources/ | | 03-May-2024 | - | 1,964 | 1,735 |
| sessions/ | | 03-May-2024 | - | 2,894 | 2,047 |
| syncable/ | | 03-May-2024 | - | 10,287 | 7,828 |
| tools/ | | 03-May-2024 | - | 157 | 124 |
| util/ | | 03-May-2024 | - | 2,823 | 1,996 |
| DEPS | D | 03-May-2024 | 108 | 6 | 4 |
| PRESUBMIT.py | D | 03-May-2024 | 479 | 14 | 6 |
| README.js | D | 03-May-2024 | 2.4 KiB | 57 | 44 |
| abstract_profile_sync_service_test.cc | D | 03-May-2024 | 4 KiB | 123 | 104 |
| abstract_profile_sync_service_test.h | D | 03-May-2024 | 1.9 KiB | 72 | 52 |
| backend_migrator.cc | D | 03-May-2024 | 6.2 KiB | 177 | 127 |
| backend_migrator.h | D | 03-May-2024 | 2.3 KiB | 72 | 41 |
| backend_migrator_unittest.cc | D | 03-May-2024 | 9.9 KiB | 268 | 208 |
| js_arg_list.cc | D | 03-May-2024 | 1.5 KiB | 56 | 35 |
| js_arg_list.h | D | 03-May-2024 | 1.4 KiB | 56 | 32 |
| js_arg_list_unittest.cc | D | 03-May-2024 | 1.6 KiB | 64 | 44 |
| js_backend.h | D | 03-May-2024 | 1.2 KiB | 45 | 21 |
| js_event_handler.h | D | 03-May-2024 | 709 | 31 | 15 |
| js_event_handler_list.cc | D | 03-May-2024 | 2.7 KiB | 95 | 71 |
| js_event_handler_list.h | D | 03-May-2024 | 2.3 KiB | 77 | 43 |
| js_event_handler_list_unittest.cc | D | 03-May-2024 | 4 KiB | 115 | 67 |
| js_event_router.h | D | 03-May-2024 | 1.1 KiB | 38 | 16 |
| js_frontend.h | D | 03-May-2024 | 1.2 KiB | 44 | 19 |
| js_sync_manager_observer.cc | D | 03-May-2024 | 4.5 KiB | 130 | 104 |
| js_sync_manager_observer.h | D | 03-May-2024 | 1.9 KiB | 57 | 38 |
| js_sync_manager_observer_unittest.cc | D | 03-May-2024 | 9.7 KiB | 281 | 221 |
| js_test_util.cc | D | 03-May-2024 | 1.9 KiB | 77 | 46 |
| js_test_util.h | D | 03-May-2024 | 2.3 KiB | 83 | 53 |
| profile_sync_factory.h | D | 03-May-2024 | 5.6 KiB | 141 | 75 |
| profile_sync_factory_impl.cc | D | 03-May-2024 | 13.5 KiB | 317 | 265 |
| profile_sync_factory_impl.h | D | 03-May-2024 | 2.9 KiB | 84 | 59 |
| profile_sync_factory_impl_unittest.cc | D | 03-May-2024 | 5.2 KiB | 140 | 110 |
| profile_sync_factory_mock.cc | D | 03-May-2024 | 1.2 KiB | 35 | 25 |
| profile_sync_factory_mock.h | D | 03-May-2024 | 3.6 KiB | 82 | 70 |
| profile_sync_service.cc | D | 03-May-2024 | 43.9 KiB | 1,305 | 979 |
| profile_sync_service.h | D | 03-May-2024 | 25.8 KiB | 651 | 273 |
| profile_sync_service_autofill_unittest.cc | D | 03-May-2024 | 43.1 KiB | 1,099 | 914 |
| profile_sync_service_bookmark_unittest.cc | D | 03-May-2024 | 48 KiB | 1,363 | 945 |
| profile_sync_service_harness.cc | D | 03-May-2024 | 22 KiB | 634 | 514 |
| profile_sync_service_harness.h | D | 03-May-2024 | 8.4 KiB | 225 | 83 |
| profile_sync_service_mock.cc | D | 03-May-2024 | 481 | 15 | 8 |
| profile_sync_service_mock.h | D | 03-May-2024 | 2.7 KiB | 66 | 53 |
| profile_sync_service_observer.h | D | 03-May-2024 | 1,006 | 25 | 10 |
| profile_sync_service_password_unittest.cc | D | 03-May-2024 | 23.5 KiB | 628 | 546 |
| profile_sync_service_preference_unittest.cc | D | 03-May-2024 | 19 KiB | 501 | 408 |
| profile_sync_service_session_unittest.cc | D | 03-May-2024 | 16.9 KiB | 434 | 361 |
| profile_sync_service_startup_unittest.cc | D | 03-May-2024 | 10.1 KiB | 267 | 194 |
| profile_sync_service_typed_url_unittest.cc | D | 03-May-2024 | 21.8 KiB | 546 | 468 |
| profile_sync_service_unittest.cc | D | 03-May-2024 | 13.7 KiB | 382 | 265 |
| profile_sync_test_util.cc | D | 03-May-2024 | 2.5 KiB | 79 | 60 |
| profile_sync_test_util.h | D | 03-May-2024 | 2.5 KiB | 89 | 65 |
| signin_manager.cc | D | 03-May-2024 | 5.8 KiB | 162 | 122 |
| signin_manager.h | D | 03-May-2024 | 3.3 KiB | 93 | 48 |
| signin_manager_unittest.cc | D | 03-May-2024 | 5.7 KiB | 167 | 122 |
| sync_setup_flow.cc | D | 03-May-2024 | 15.2 KiB | 411 | 340 |
| sync_setup_flow.h | D | 03-May-2024 | 6.3 KiB | 172 | 98 |
| sync_setup_flow_handler.h | D | 03-May-2024 | 1.2 KiB | 36 | 23 |
| sync_setup_wizard.cc | D | 03-May-2024 | 2.6 KiB | 90 | 67 |
| sync_setup_wizard.h | D | 03-May-2024 | 3.5 KiB | 97 | 38 |
| sync_setup_wizard_unittest.cc | D | 03-May-2024 | 19.8 KiB | 537 | 434 |
| sync_ui_util.cc | D | 03-May-2024 | 17.6 KiB | 447 | 371 |
| sync_ui_util.h | D | 03-May-2024 | 2.8 KiB | 74 | 40 |
| sync_ui_util_mac.h | D | 03-May-2024 | 922 | 30 | 12 |
| sync_ui_util_mac.mm | D | 03-May-2024 | 2.4 KiB | 72 | 62 |
| sync_ui_util_mac_unittest.mm | D | 03-May-2024 | 3.9 KiB | 109 | 88 |
| sync_ui_util_unittest.cc | D | 03-May-2024 | 1.5 KiB | 43 | 28 |
| test_profile_sync_service.cc | D | 03-May-2024 | 8.8 KiB | 263 | 208 |
| test_profile_sync_service.h | D | 03-May-2024 | 4.6 KiB | 140 | 78 |
| unrecoverable_error_handler.h | D | 03-May-2024 | 972 | 30 | 15 |
README.js
1 Overview of chrome://sync-internals
2 -----------------------------------
3
4 This note explains how chrome://sync-internals (also known as
5 about:sync) interacts with the sync service/backend.
6
7 Basically, chrome://sync-internals sends asynchronous messages to the
8 sync backend and the sync backend asynchronously raises events to
9 chrome://sync-internals, either when replying to messages or when
10 something interesting happens.
11
12 Both messages and events have a name and a list of arguments, the
13 latter of which is represented by a JsArgList (js_arg_list.h) object,
14 which is basically a wrapper around an immutable ListValue.
15
16 TODO(akalin): Move all the js_* files into a js/ subdirectory.
17
18 Message/event flow
19 ------------------
20
21 chrome://sync-internals is represented by SyncInternalsUI
22 (chrome/browser/web_ui/sync_internals_ui.h). SyncInternalsUI
23 interacts with the sync service via a JsFrontend (js_frontend.h)
24 object, which has a ProcessMessage() method. The JsFrontend can
25 handle some messages itself, but it can also delegate the rest to a
26 JsBackend instance (js_backend.h), which also has a ProcessMessage()
27 method. A JsBackend can in turn handle some messages itself and
28 delegate to other JsBackend instances.
29
30 Essentially, there is a tree with a JsFrontend as the root and
31 JsBackend as non-root internal nodes and leaf nodes (although
32 currently, the tree is more like a simple list). The sets of messages
33 handled by the JsBackends and the JsFrontend are disjoint, which means
34 that at most one node handles a given message type. Also, the
35 JsBackends may live on different threads, but JsArgList is thread-safe
36 so that's okay.
37
38 SyncInternalsUI is a JsEventHandler (js_event_handler.h), which means
39 that it has a HandleJsEvent() method, but JsBackends cannot easily
40 access those objects. Instead, each JsBackend keeps track of its
41 parent router, which is a JsEventRouter object (js_event_router.h).
42 Basically, a JsEventRouter is another JsBackend object or a JsFrontend
43 object. So an event travels up through the JsEventRouter until it
44 reaches the JsFrontend, which knows about the existing JsEventHandlers
45 (via AddHandler()/RemoveHandler()) and so can delegate to the right
46 one.
47
48 A diagram of the flow of a message and its reply:
49
50 msg(args) -> F -> B -> B -> B
51 | | |
52 H <- R <- R <- R <- reply-event(args)
53
54 F = JsFrontend, B = JsBackend, R = JsEventRouter, H = JsEventHandler
55
56 Non-reply events are percolated up similarly.
57