diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 01:20:14 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-01 01:20:14 +0000 |
commit | 8644dfa1f63dfc3a0d01132cd1b1287dde4b29ce (patch) | |
tree | 6061b89e755dd9481ff7f4330b3b3878efc3d844 /sync/internal_api/sync_manager_impl.h | |
parent | bb8558a3ce708090430615cb69f696c096ee8ac7 (diff) | |
download | chromium_src-8644dfa1f63dfc3a0d01132cd1b1287dde4b29ce.zip chromium_src-8644dfa1f63dfc3a0d01132cd1b1287dde4b29ce.tar.gz chromium_src-8644dfa1f63dfc3a0d01132cd1b1287dde4b29ce.tar.bz2 |
sync: Buffer Protocol Events for about:sync page
Allows the about:sync page to present the last six network events as
soon as it's opened.
Adds the ProtocolEventBuffer to the SyncManagerImpl. This class holds
on to a few protocol events and returns them on demand.
Modifies the interface to enable SyncBacknedHost protocol event
forwarding. By default, it does not forward any events. There are now
separate registration and unregistration functions. The registration
function will send the set of buffered notifications to the UI thread,
and also register it to receive incoming events in the future. It
continues to forward events until the number of registration calls is
matched by the number of un-registration calls.
Makes about:sync's registration to receive events explicit. This was
a long-time TODO. If we did not fix this issue, then the about:sync
page could receive the initial set of buffered invalidations before it
had its event listeners defined and registered.
Makes the about:sync page keep track of known events and avoid adding
duplicates to the list. Since the registration of a new event listener
causes events to be distributed to all listeners, we must add this logic
to ensure that opening one new about:sync tab will not cause previously
opened tabs to display duplicate events.
BUG=329373,349301
Review URL: https://codereview.chromium.org/212603007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl.h')
-rw-r--r-- | sync/internal_api/sync_manager_impl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h index 5cb3908..8219605 100644 --- a/sync/internal_api/sync_manager_impl.h +++ b/sync/internal_api/sync_manager_impl.h @@ -19,6 +19,7 @@ #include "sync/internal_api/js_mutation_event_observer.h" #include "sync/internal_api/js_sync_encryption_handler_observer.h" #include "sync/internal_api/js_sync_manager_observer.h" +#include "sync/internal_api/protocol_event_buffer.h" #include "sync/internal_api/public/sync_manager.h" #include "sync/internal_api/public/user_share.h" #include "sync/internal_api/sync_encryption_handler_impl.h" @@ -115,6 +116,8 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl : virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; virtual bool HasUnsyncedItems() OVERRIDE; virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; + virtual ScopedVector<syncer::ProtocolEvent> + GetBufferedProtocolEvents() OVERRIDE; // SyncEncryptionHandler::Observer implementation. virtual void OnPassphraseRequired( @@ -358,6 +361,7 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl : // This is for keeping track of client events to send to the server. DebugInfoEventListener debug_info_event_listener_; + ProtocolEventBuffer protocol_event_buffer_; TrafficRecorder traffic_recorder_; Encryptor* encryptor_; |