diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 04:29:44 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 04:29:44 +0000 |
commit | bd6007ea79376728e7096a3261e812908933ba85 (patch) | |
tree | a794320cf3d5a922c7af84f965c5f6a30624cf4e /sync/notifier/object_id_state_map.h | |
parent | 3e59af452cc296f22e14ee738594fec9cee38e7c (diff) | |
download | chromium_src-bd6007ea79376728e7096a3261e812908933ba85.zip chromium_src-bd6007ea79376728e7096a3261e812908933ba85.tar.gz chromium_src-bd6007ea79376728e7096a3261e812908933ba85.tar.bz2 |
Refactor ModelTypePayloadMap and ObjectIdPayloadMap to StateMaps.
This lays the groundwork for allowing us to pass ack handles for object IDs to
SyncNotifierObservers.
BUG=124149
TEST=none, there should be no behavior change.
Review URL: https://chromiumcodereview.appspot.com/10837214
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/notifier/object_id_state_map.h')
-rw-r--r-- | sync/notifier/object_id_state_map.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sync/notifier/object_id_state_map.h b/sync/notifier/object_id_state_map.h new file mode 100644 index 0000000..17f8ceb --- /dev/null +++ b/sync/notifier/object_id_state_map.h @@ -0,0 +1,35 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SYNC_NOTIFIER_OBJECT_ID_STATE_MAP_H_ +#define SYNC_NOTIFIER_OBJECT_ID_STATE_MAP_H_ + +#include <map> +#include <string> + +#include "google/cacheinvalidation/include/types.h" +#include "sync/internal_api/public/base/invalidation_state.h" +#include "sync/internal_api/public/base/model_type_state_map.h" +#include "sync/notifier/invalidation_util.h" + +namespace syncer { + +typedef std::map<invalidation::ObjectId, + InvalidationState, + ObjectIdLessThan> ObjectIdStateMap; + +// Converts between ObjectIdStateMaps and ObjectIdSets. +ObjectIdSet ObjectIdStateMapToSet(const ObjectIdStateMap& id_payloads); +ObjectIdStateMap ObjectIdSetToStateMap(const ObjectIdSet& ids, + const std::string& payload); + +// Converts between ObjectIdStateMaps and ModelTypeStateMaps. +ModelTypeStateMap ObjectIdStateMapToModelTypeStateMap( + const ObjectIdStateMap& id_payloads); +ObjectIdStateMap ModelTypeStateMapToObjectIdStateMap( + const ModelTypeStateMap& type_payloads); + +} // namespace syncer + +#endif // HOME_DCHENG_SRC_CHROMIUM_SRC_SYNC_NOTIFIER_OBJECT_ID_STATE_MAP_H_ |