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