Chromium Code Reviews| Index: chrome/browser/sync/engine/syncer_thread.h |
| =================================================================== |
| --- chrome/browser/sync/engine/syncer_thread.h (revision 71618) |
| +++ chrome/browser/sync/engine/syncer_thread.h (working copy) |
| @@ -10,6 +10,7 @@ |
| #pragma once |
| #include <list> |
| +#include <map> |
|
akalin
2011/01/21 19:50:09
No need for this since you're using the typedef fr
Nicolas Zea
2011/01/21 21:57:44
Done.
|
| #include <string> |
| #include <vector> |
| @@ -49,6 +50,9 @@ |
| FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, NudgeWithDataTypes); |
| FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, |
| NudgeWithDataTypesCoalesced); |
| + FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, NudgeWithPayloads); |
| + FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, |
| + NudgeWithPayloadsCoalesced); |
| FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, Throttling); |
| FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, AuthInvalid); |
| FRIEND_TEST_ALL_PREFIXES(SyncerThreadWithSyncerTest, Pause); |
| @@ -138,8 +142,16 @@ |
| virtual void NudgeSyncerWithDataTypes( |
| int milliseconds_from_now, |
| NudgeSource source, |
| - const syncable::ModelTypeBitSet& model_type); |
| + const syncable::ModelTypeBitSet& model_types); |
| + // Same as |NudgeSyncer|, but supports including a payload for passing on to |
| + // the download updates command. Datatypes with payloads are also considered |
| + // to have caused a nudged to occur and treated accordingly. |
| + virtual void NudgeSyncerWithPayloads( |
| + int milliseconds_from_now, |
| + NudgeSource source, |
| + const sessions::SyncSourceInfo::ModelTypeMap& model_types_with_payloads); |
| + |
| void SetNotificationsEnabled(bool notifications_enabled); |
| // Call this when a directory is opened |
| @@ -189,9 +201,13 @@ |
| // check pending_nudge_time_.) |
| NudgeSource pending_nudge_source_; |
| - // BitSet of the datatypes that have triggered the current nudge |
| - // (can be union of various bitsets when multiple nudges are coalesced) |
| - syncable::ModelTypeBitSet pending_nudge_types_; |
| + // Map of all datatypes that are requesting a nudge. Can be union |
| + // from multiple nudges that are coalesced. In addition, we |
| + // optionally track a payload associated with each datatype (most recent |
| + // payload overwrites old ones). These payloads are used by the download |
| + // updates command and can contain datatype specific information the server |
| + // might use. |
| + sessions::SyncSourceInfo::ModelTypeMap pending_nudge_types_; |
| // null iff there is no pending nudge. |
| base::TimeTicks pending_nudge_time_; |
| @@ -280,7 +296,7 @@ |
| sessions::SyncSourceInfo MakeSyncSourceInfo( |
| bool nudged, |
| NudgeSource nudge_source, |
| - const syncable::ModelTypeBitSet& nudge_types, |
| + const sessions::SyncSourceInfo::ModelTypeMap& nudge_types, |
|
akalin
2011/01/21 19:50:09
rename to model_types_with_payloads to be consiste
Nicolas Zea
2011/01/21 21:57:44
Done.
|
| bool* initial_sync); |
| int UserIdleTime(); |
| @@ -327,7 +343,7 @@ |
| void NudgeSyncImpl( |
| int milliseconds_from_now, |
| NudgeSource source, |
| - const syncable::ModelTypeBitSet& model_types); |
| + const sessions::SyncSourceInfo::ModelTypeMap& model_types_with_payloads); |
| #if defined(OS_LINUX) |
| // On Linux, we need this information in order to query idle time. |