Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / sync / syncable / syncable_util.h
blobbe903fd5954599a27f53fe87f522b84c488f3a54
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SYNC_SYNCABLE_SYNCABLE_UTIL_H_
6 #define SYNC_SYNCABLE_SYNCABLE_UTIL_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "sync/base/sync_export.h"
13 #include "sync/internal_api/public/base/model_type.h"
15 namespace tracked_objects {
16 class Location;
19 namespace syncer {
20 namespace syncable {
22 class BaseTransaction;
23 class BaseWriteTransaction;
24 class ModelNeutralMutableEntry;
25 class Id;
27 SYNC_EXPORT_PRIVATE void ChangeEntryIDAndUpdateChildren(
28 BaseWriteTransaction* trans,
29 ModelNeutralMutableEntry* entry,
30 const Id& new_id);
32 SYNC_EXPORT_PRIVATE bool IsLegalNewParent(BaseTransaction* trans,
33 const Id& id,
34 const Id& parentid);
36 bool SyncAssert(bool condition,
37 const tracked_objects::Location& location,
38 const char* msg,
39 BaseTransaction* trans);
41 SYNC_EXPORT_PRIVATE int GetUnsyncedEntries(BaseTransaction* trans,
42 std::vector<int64> *handles);
44 // Generates a fixed-length tag for the given string under the given model_type.
45 SYNC_EXPORT_PRIVATE std::string GenerateSyncableHash(
46 ModelType model_type, const std::string& client_tag);
48 // A helper for generating the bookmark type's tag. This is required in more
49 // than one place, so we define the algorithm here to make sure the
50 // implementation is consistent.
51 SYNC_EXPORT_PRIVATE std::string GenerateSyncableBookmarkHash(
52 const std::string& originator_cache_guid,
53 const std::string& originator_client_item_id);
55 } // namespace syncable
56 } // namespace syncer
58 #endif // SYNC_SYNCABLE_SYNCABLE_UTIL_H_