[email protected] | 1bfd03f | 2011-07-02 19:04:18 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | // | ||||
5 | // Various utilities for dealing with invalidation data types. | ||||
6 | |||||
7 | #ifndef CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | ||||
8 | #define CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 9 | #pragma once |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 10 | |
11 | #include <string> | ||||
12 | |||||
[email protected] | 6a1d0f5 | 2010-06-30 05:11:53 | [diff] [blame] | 13 | #include "chrome/browser/sync/syncable/model_type.h" |
[email protected] | 1bfd03f | 2011-07-02 19:04:18 | [diff] [blame] | 14 | #include "google/cacheinvalidation/callback.h" |
[email protected] | d49f4633 | 2011-07-15 21:31:07 | [diff] [blame^] | 15 | |
16 | namespace invalidation { | ||||
17 | |||||
18 | class Invalidation; | ||||
19 | class ObjectId; | ||||
20 | |||||
21 | } // namespace invalidation | ||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 22 | |
23 | namespace sync_notifier { | ||||
24 | |||||
25 | void RunAndDeleteClosure(invalidation::Closure* task); | ||||
26 | |||||
[email protected] | 6a1d0f5 | 2010-06-30 05:11:53 | [diff] [blame] | 27 | bool RealModelTypeToObjectId(syncable::ModelType model_type, |
28 | invalidation::ObjectId* object_id); | ||||
29 | |||||
30 | bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, | ||||
31 | syncable::ModelType* model_type); | ||||
32 | |||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 33 | std::string ObjectIdToString(const invalidation::ObjectId& object_id); |
34 | |||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 35 | std::string InvalidationToString( |
36 | const invalidation::Invalidation& invalidation); | ||||
37 | |||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 38 | } // namespace sync_notifier |
39 | |||||
40 | #endif // CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |