Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 5 #ifndef SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| 6 #define SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 6 #define SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 class SyncSessionContext; | 32 class SyncSessionContext; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace syncable { | 35 namespace syncable { |
| 36 class Directory; | 36 class Directory; |
| 37 class Entry; | 37 class Entry; |
| 38 } | 38 } |
| 39 | 39 |
| 40 class SyncerProtoUtil { | 40 class SyncerProtoUtil { |
| 41 public: | 41 public: |
| 42 // Posts the given message and fills the buffer with the returned value. | 42 // Posts the given message and fills the buffer with the returned value. |
|
akalin
2012/09/17 03:30:23
add comment about how required fields are set for
| |
| 43 // Returns true on success. Also handles store birthday verification: will | 43 // Returns true on success. Also handles store birthday verification: will |
| 44 // produce a SyncError if the birthday is incorrect. | 44 // produce a SyncError if the birthday is incorrect. |
| 45 static SyncerError PostClientToServerMessage( | 45 static SyncerError PostClientToServerMessage( |
| 46 const sync_pb::ClientToServerMessage& msg, | 46 sync_pb::ClientToServerMessage* msg, |
| 47 sync_pb::ClientToServerResponse* response, | 47 sync_pb::ClientToServerResponse* response, |
| 48 sessions::SyncSession* session); | 48 sessions::SyncSession* session); |
| 49 | 49 |
| 50 // Compares a syncable Entry to SyncEntity, returns true iff the data is | 50 // Compares a syncable Entry to SyncEntity, returns true iff the data is |
| 51 // identical. | 51 // identical. |
| 52 // | 52 // |
| 53 // TODO(sync): The places where this function is used are arguable big causes | 53 // TODO(sync): The places where this function is used are arguable big causes |
| 54 // of the fragility, because there's a tendency to freak out the moment the | 54 // of the fragility, because there's a tendency to freak out the moment the |
| 55 // local and server values diverge. However, this almost always indicates a | 55 // local and server values diverge. However, this almost always indicates a |
| 56 // sync bug somewhere earlier in the sync cycle. | 56 // sync bug somewhere earlier in the sync cycle. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); | 143 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); |
| 144 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); | 144 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); |
| 145 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); | 145 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); | 147 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 } // namespace syncer | 150 } // namespace syncer |
| 151 | 151 |
| 152 #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 152 #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| OLD | NEW |