OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "chrome/browser/sync/engine/sync_error.h" |
| 13 #include "chrome/browser/sync/protocol/sync.pb.h" |
12 #include "chrome/browser/sync/syncable/blob.h" | 14 #include "chrome/browser/sync/syncable/blob.h" |
13 #include "chrome/browser/sync/syncable/model_type.h" | 15 #include "chrome/browser/sync/syncable/model_type.h" |
14 | 16 |
15 namespace syncable { | 17 namespace syncable { |
16 class Directory; | 18 class Directory; |
17 class Entry; | 19 class Entry; |
18 class ScopedDirLookup; | 20 class ScopedDirLookup; |
19 class SyncName; | 21 class SyncName; |
20 } // namespace syncable | 22 } // namespace syncable |
21 | 23 |
22 namespace sync_pb { | 24 namespace sync_pb { |
23 class ClientToServerResponse; | 25 class ClientToServerResponse; |
24 class EntitySpecifics; | 26 class EntitySpecifics; |
25 } // namespace sync_pb | 27 } // namespace sync_pb |
26 | 28 |
27 namespace browser_sync { | 29 namespace browser_sync { |
28 | 30 |
29 namespace sessions { | 31 namespace sessions { |
30 class SyncSession; | 32 class SyncSession; |
31 } | 33 } |
32 | 34 |
33 class AuthWatcher; | 35 class AuthWatcher; |
34 class ClientToServerMessage; | 36 class ClientToServerMessage; |
35 class ServerConnectionManager; | 37 class ServerConnectionManager; |
36 class SyncEntity; | 38 class SyncEntity; |
37 class CommitResponse_EntryResponse; | 39 class CommitResponse_EntryResponse; |
38 | 40 |
| 41 bool ShouldRequestEarlyExit(const sync_api::SyncError& error); |
| 42 |
39 class SyncerProtoUtil { | 43 class SyncerProtoUtil { |
40 public: | 44 public: |
41 // Posts the given message and fills the buffer with the returned value. | 45 // Posts the given message and fills the buffer with the returned value. |
42 // Returns true on success. Also handles store birthday verification: | 46 // Returns true on success. Also handles store birthday verification: |
43 // session->status()->syncer_stuck_ is set true if the birthday is | 47 // session->status()->syncer_stuck_ is set true if the birthday is |
44 // incorrect. A false value will always be returned if birthday is bad. | 48 // incorrect. A false value will always be returned if birthday is bad. |
45 static bool PostClientToServerMessage( | 49 static bool PostClientToServerMessage( |
46 const ClientToServerMessage& msg, | 50 const ClientToServerMessage& msg, |
47 sync_pb::ClientToServerResponse* response, | 51 sync_pb::ClientToServerResponse* response, |
48 sessions::SyncSession* session); | 52 sessions::SyncSession* session); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, AddRequestBirthday); | 126 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, AddRequestBirthday); |
123 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, PostAndProcessHeaders); | 127 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, PostAndProcessHeaders); |
124 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); | 128 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); |
125 | 129 |
126 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); | 130 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); |
127 }; | 131 }; |
128 | 132 |
129 } // namespace browser_sync | 133 } // namespace browser_sync |
130 | 134 |
131 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 135 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
OLD | NEW |