Home | History | Annotate | only in /external/chromium/chrome/browser/sync
Up to higher level directory
NameDateSize
abstract_profile_sync_service_test.cc15-Nov-20114K
abstract_profile_sync_service_test.h15-Nov-20111.9K
backend_migrator.cc15-Nov-20116.2K
backend_migrator.h15-Nov-20112.3K
backend_migrator_unittest.cc15-Nov-20119.9K
DEPS15-Nov-2011108
engine/15-Nov-2011
glue/15-Nov-2011
js_arg_list.cc15-Nov-20111.5K
js_arg_list.h15-Nov-20111.4K
js_arg_list_unittest.cc15-Nov-20111.6K
js_backend.h15-Nov-20111.2K
js_event_handler.h15-Nov-2011709
js_event_handler_list.cc15-Nov-20112.7K
js_event_handler_list.h15-Nov-20112.3K
js_event_handler_list_unittest.cc15-Nov-20114K
js_event_router.h15-Nov-20111.1K
js_frontend.h15-Nov-20111.2K
js_sync_manager_observer.cc15-Nov-20114.5K
js_sync_manager_observer.h15-Nov-20111.9K
js_sync_manager_observer_unittest.cc15-Nov-20119.7K
js_test_util.cc15-Nov-20111.9K
js_test_util.h15-Nov-20112.3K
notifier/15-Nov-2011
PRESUBMIT.py15-Nov-2011479
profile_sync_factory.h15-Nov-20115.6K
profile_sync_factory_impl.cc15-Nov-201113.5K
profile_sync_factory_impl.h15-Nov-20112.9K
profile_sync_factory_impl_unittest.cc15-Nov-20115.2K
profile_sync_factory_mock.cc15-Nov-20111.2K
profile_sync_factory_mock.h15-Nov-20113.6K
profile_sync_service.cc15-Nov-201143.9K
profile_sync_service.h15-Nov-201125.8K
profile_sync_service_autofill_unittest.cc15-Nov-201143.1K
profile_sync_service_bookmark_unittest.cc15-Nov-201148K
profile_sync_service_harness.cc15-Nov-201122K
profile_sync_service_harness.h15-Nov-20118.4K
profile_sync_service_mock.cc15-Nov-2011481
profile_sync_service_mock.h15-Nov-20112.7K
profile_sync_service_observer.h15-Nov-20111,006
profile_sync_service_password_unittest.cc15-Nov-201123.5K
profile_sync_service_preference_unittest.cc15-Nov-201119K
profile_sync_service_session_unittest.cc15-Nov-201116.9K
profile_sync_service_startup_unittest.cc15-Nov-201110.1K
profile_sync_service_typed_url_unittest.cc15-Nov-201121.8K
profile_sync_service_unittest.cc15-Nov-201113.7K
profile_sync_test_util.cc15-Nov-20112.5K
profile_sync_test_util.h15-Nov-20112.5K
protocol/15-Nov-2011
README.js15-Nov-20112.4K
resources/15-Nov-2011
sessions/15-Nov-2011
signin_manager.cc15-Nov-20115.8K
signin_manager.h15-Nov-20113.3K
signin_manager_unittest.cc15-Nov-20115.7K
sync_setup_flow.cc15-Nov-201115.2K
sync_setup_flow.h15-Nov-20116.3K
sync_setup_flow_handler.h15-Nov-20111.2K
sync_setup_wizard.cc15-Nov-20112.6K
sync_setup_wizard.h15-Nov-20113.5K
sync_setup_wizard_unittest.cc15-Nov-201119.8K
sync_ui_util.cc15-Nov-201117.6K
sync_ui_util.h15-Nov-20112.8K
sync_ui_util_mac.h15-Nov-2011922
sync_ui_util_mac.mm15-Nov-20112.4K
sync_ui_util_mac_unittest.mm15-Nov-20113.9K
sync_ui_util_unittest.cc15-Nov-20111.5K
syncable/15-Nov-2011
test_profile_sync_service.cc15-Nov-20118.8K
test_profile_sync_service.h15-Nov-20114.6K
tools/15-Nov-2011
unrecoverable_error_handler.h15-Nov-2011972
util/15-Nov-2011

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