| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "sync/internal_api/public/syncable/model_type.h" | 13 #include "sync/internal_api/public/syncable/model_type.h" |
| 14 #include "sync/internal_api/public/util/syncer_error.h" | 14 #include "sync/internal_api/public/util/syncer_error.h" |
| 15 #include "sync/sessions/sync_session.h" | 15 #include "sync/sessions/sync_session.h" |
| 16 #include "sync/syncable/blob.h" | 16 #include "sync/syncable/blob.h" |
| 17 | 17 |
| 18 namespace syncable { | |
| 19 class Directory; | |
| 20 class Entry; | |
| 21 } // namespace syncable | |
| 22 | |
| 23 namespace sync_pb { | 18 namespace sync_pb { |
| 24 class ClientToServerResponse; | 19 class ClientToServerResponse; |
| 25 class EntitySpecifics; | 20 class EntitySpecifics; |
| 26 } // namespace sync_pb | 21 } |
| 27 | 22 |
| 28 namespace syncer { | 23 namespace syncer { |
| 29 | 24 |
| 30 namespace sessions { | |
| 31 class SyncProtocolError; | |
| 32 class SyncSessionContext; | |
| 33 } | |
| 34 | |
| 35 class ClientToServerMessage; | 25 class ClientToServerMessage; |
| 36 class ThrottledDataTypeTracker; | 26 class ThrottledDataTypeTracker; |
| 37 class ServerConnectionManager; | 27 class ServerConnectionManager; |
| 38 class SyncEntity; | 28 class SyncEntity; |
| 39 class CommitResponse_EntryResponse; | 29 class CommitResponse_EntryResponse; |
| 40 | 30 |
| 31 namespace sessions { |
| 32 class SyncProtocolError; |
| 33 class SyncSessionContext; |
| 34 } |
| 35 |
| 36 namespace syncable { |
| 37 class Directory; |
| 38 class Entry; |
| 39 } |
| 40 |
| 41 class SyncerProtoUtil { | 41 class SyncerProtoUtil { |
| 42 public: | 42 public: |
| 43 // Posts the given message and fills the buffer with the returned value. | 43 // Posts the given message and fills the buffer with the returned value. |
| 44 // Returns true on success. Also handles store birthday verification: will | 44 // Returns true on success. Also handles store birthday verification: will |
| 45 // produce a SyncError if the birthday is incorrect. | 45 // produce a SyncError if the birthday is incorrect. |
| 46 static SyncerError PostClientToServerMessage( | 46 static SyncerError PostClientToServerMessage( |
| 47 const ClientToServerMessage& msg, | 47 const ClientToServerMessage& msg, |
| 48 sync_pb::ClientToServerResponse* response, | 48 sync_pb::ClientToServerResponse* response, |
| 49 sessions::SyncSession* session); | 49 sessions::SyncSession* session); |
| 50 | 50 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); | 131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); |
| 132 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); | 132 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); |
| 133 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); | 133 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); | 135 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace syncer | 138 } // namespace syncer |
| 139 | 139 |
| 140 #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 140 #endif // SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
| OLD | NEW |