[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 1 | // Copyright (c) 2010 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. |
| 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_ |
| 9 | |
| 10 | #include <string> |
| 11 | |
[email protected] | 6a1d0f5 | 2010-06-30 05:11:53 | [diff] [blame^] | 12 | #include "chrome/browser/sync/syncable/model_type.h" |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 13 | #include "google/cacheinvalidation/invalidation-client.h" |
| 14 | |
| 15 | namespace sync_notifier { |
| 16 | |
| 17 | void RunAndDeleteClosure(invalidation::Closure* task); |
| 18 | |
[email protected] | 6a1d0f5 | 2010-06-30 05:11:53 | [diff] [blame^] | 19 | bool RealModelTypeToObjectId(syncable::ModelType model_type, |
| 20 | invalidation::ObjectId* object_id); |
| 21 | |
| 22 | bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, |
| 23 | syncable::ModelType* model_type); |
| 24 | |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 25 | // We need to write our own protobuf-to-string functions because we |
| 26 | // use LITE_RUNTIME, which doesn't support DebugString(). |
| 27 | |
| 28 | std::string ObjectIdToString(const invalidation::ObjectId& object_id); |
| 29 | |
| 30 | std::string StatusToString(const invalidation::Status& status); |
| 31 | |
| 32 | std::string InvalidationToString( |
| 33 | const invalidation::Invalidation& invalidation); |
| 34 | |
| 35 | std::string RegistrationUpdateToString( |
| 36 | const invalidation::RegistrationUpdate& update); |
| 37 | |
| 38 | std::string RegistrationUpdateResultToString( |
| 39 | const invalidation::RegistrationUpdateResult& update_result); |
| 40 | |
| 41 | } // namespace sync_notifier |
| 42 | |
| 43 | #endif // CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |