| OLD | NEW | 
|   1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |   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 |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4 // |   4 // | 
|   5 // Various utilities for dealing with invalidation data types. |   5 // Various utilities for dealing with invalidation data types. | 
|   6  |   6  | 
|   7 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |   7 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | 
|   8 #define CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |   8 #define CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | 
|   9  |   9  | 
|  10 #include <string> |  10 #include <string> | 
|  11  |  11  | 
 |  12 #include "chrome/browser/sync/syncable/model_type.h" | 
|  12 #include "google/cacheinvalidation/invalidation-client.h" |  13 #include "google/cacheinvalidation/invalidation-client.h" | 
|  13  |  14  | 
|  14 namespace sync_notifier { |  15 namespace sync_notifier { | 
|  15  |  16  | 
|  16 void RunAndDeleteClosure(invalidation::Closure* task); |  17 void RunAndDeleteClosure(invalidation::Closure* task); | 
|  17  |  18  | 
 |  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  | 
|  18 // We need to write our own protobuf-to-string functions because we |  25 // We need to write our own protobuf-to-string functions because we | 
|  19 // use LITE_RUNTIME, which doesn't support DebugString(). |  26 // use LITE_RUNTIME, which doesn't support DebugString(). | 
|  20  |  27  | 
|  21 std::string ObjectIdToString(const invalidation::ObjectId& object_id); |  28 std::string ObjectIdToString(const invalidation::ObjectId& object_id); | 
|  22  |  29  | 
|  23 std::string StatusToString(const invalidation::Status& status); |  30 std::string StatusToString(const invalidation::Status& status); | 
|  24  |  31  | 
|  25 std::string InvalidationToString( |  32 std::string InvalidationToString( | 
|  26     const invalidation::Invalidation& invalidation); |  33     const invalidation::Invalidation& invalidation); | 
|  27  |  34  | 
|  28 std::string RegistrationUpdateToString( |  35 std::string RegistrationUpdateToString( | 
|  29     const invalidation::RegistrationUpdate& update); |  36     const invalidation::RegistrationUpdate& update); | 
|  30  |  37  | 
|  31 std::string RegistrationUpdateResultToString( |  38 std::string RegistrationUpdateResultToString( | 
|  32     const invalidation::RegistrationUpdateResult& update_result); |  39     const invalidation::RegistrationUpdateResult& update_result); | 
|  33  |  40  | 
|  34 }  // namespace sync_notifier |  41 }  // namespace sync_notifier | 
|  35  |  42  | 
|  36 #endif  // CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |  43 #endif  // CHROME_BROWSER_SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | 
| OLD | NEW |