Home | History | Annotate | only in /external/chromium_org/sync/js
Up to higher level directory
NameDateSize
DEPS06-Dec-201388
js_arg_list.cc06-Dec-2013592
js_arg_list.h06-Dec-20131K
js_arg_list_unittest.cc06-Dec-20131.1K
js_backend.h06-Dec-20131.1K
js_controller.h06-Dec-20131.6K
js_event_details.cc06-Dec-2013665
js_event_details.h06-Dec-20131.1K
js_event_details_unittest.cc06-Dec-2013945
js_event_handler.h06-Dec-2013705
js_reply_handler.h06-Dec-2013657
js_test_util.cc06-Dec-20133.7K
js_test_util.h06-Dec-20133.1K
README.js06-Dec-20131.9K
sync_js_controller.cc06-Dec-20132.7K
sync_js_controller.h06-Dec-20132.5K
sync_js_controller_unittest.cc06-Dec-20134.3K

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 messages to the sync backend
      8 and the sync backend sends the reply asynchronously.  The sync backend
      9 also asynchronously raises events which chrome://sync-internals listen
     10 to.
     11 
     12 A message and its reply has a name and a list of arguments, which is
     13 basically a wrapper around an immutable ListValue.
     14 
     15 An event has a name and a details object, which is represented by a
     16 JsEventDetails (js_event_details.h) object, which is basically a
     17 wrapper around an immutable DictionaryValue.
     18 
     19 Message/event flow
     20 ------------------
     21 
     22 chrome://sync-internals is represented by SyncInternalsUI
     23 (chrome/browser/ui/webui/sync_internals_ui.h).  SyncInternalsUI
     24 interacts with the sync service via a JsController (js_controller.h)
     25 object, which has a ProcessJsMessage() method that just delegates to
     26 an underlying JsBackend instance (js_backend.h).  The SyncInternalsUI
     27 object also registers itself (as a JsEventHandler
     28 [js_event_handler.h]) to the JsController object, and any events
     29 raised by the JsBackend are propagated to the JsController and then to
     30 the registered JsEventHandlers.
     31 
     32 The ProcessJsMessage() takes a WeakHandle (weak_handle.h) to a
     33 JsReplyHandler (js_reply_handler.h), which the backend uses to send
     34 replies safely across threads.  SyncInternalsUI implements
     35 JsReplyHandler, so it simply passes itself as the reply handler when
     36 it calls ProcessJsMessage() on the JsController.
     37 
     38 The following objects live on the UI thread:
     39 
     40 - SyncInternalsUI (implements JsEventHandler, JsReplyHandler)
     41 - SyncJsController (implements JsController, JsEventHandler)
     42 
     43 The following objects live on the sync thread:
     44 
     45 - SyncManager::SyncInternal (implements JsBackend)
     46 
     47 Of course, none of these objects need to know where the other objects
     48 live, since they interact via WeakHandles.
     49