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 CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 class ClientToServerMessage; | 35 class ClientToServerMessage; |
36 class ServerConnectionManager; | 36 class ServerConnectionManager; |
37 class SyncEntity; | 37 class SyncEntity; |
38 class CommitResponse_EntryResponse; | 38 class CommitResponse_EntryResponse; |
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. |
43 // Returns true on success. Also handles store birthday verification: | 43 // Returns true on success. Also handles store birthday verification: will |
44 // session->status()->syncer_stuck_ is set true if the birthday is | 44 // produce a SyncError if the birthday is incorrect. |
45 // incorrect. A false value will always be returned if birthday is bad. | |
46 static SyncerError PostClientToServerMessage( | 45 static SyncerError PostClientToServerMessage( |
47 const ClientToServerMessage& msg, | 46 const ClientToServerMessage& msg, |
48 sync_pb::ClientToServerResponse* response, | 47 sync_pb::ClientToServerResponse* response, |
49 sessions::SyncSession* session); | 48 sessions::SyncSession* session); |
50 | 49 |
51 // 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 |
52 // identical. | 51 // identical. |
53 // | 52 // |
54 // 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 |
55 // 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 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); | 129 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); |
131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); | 130 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); |
132 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); | 131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); |
133 | 132 |
134 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); | 133 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); |
135 }; | 134 }; |
136 | 135 |
137 } // namespace browser_sync | 136 } // namespace browser_sync |
138 | 137 |
139 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 138 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
OLD | NEW |