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" |
akalin
2011/11/21 20:04:26
#include "base/time.h"
lipalani1
2011/11/21 21:55:38
Done.
| |
12 #include "chrome/browser/sync/sessions/sync_session.h" | |
13 #include "chrome/browser/sync/sessions/sync_session_context.h" | |
akalin
2011/11/21 20:04:26
forward-declare context and syncprotocolerror
lipalani1
2011/11/21 21:55:38
Done.
| |
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 } // namespace syncable | 20 } // namespace syncable |
19 | 21 |
20 namespace sync_pb { | 22 namespace sync_pb { |
21 class ClientToServerResponse; | 23 class ClientToServerResponse; |
22 class EntitySpecifics; | 24 class EntitySpecifics; |
23 } // namespace sync_pb | 25 } // namespace sync_pb |
24 | 26 |
25 namespace browser_sync { | 27 namespace browser_sync { |
26 | 28 |
27 namespace sessions { | 29 namespace sessions { |
28 class SyncSession; | 30 class SyncSession; |
akalin
2011/11/21 20:04:26
remove this since you're #including now
lipalani1
2011/11/21 21:55:38
Done.
| |
29 } | 31 } |
30 | 32 |
31 class ClientToServerMessage; | 33 class ClientToServerMessage; |
32 class ServerConnectionManager; | 34 class ServerConnectionManager; |
33 class SyncEntity; | 35 class SyncEntity; |
34 class CommitResponse_EntryResponse; | 36 class CommitResponse_EntryResponse; |
35 | 37 |
36 class SyncerProtoUtil { | 38 class SyncerProtoUtil { |
37 public: | 39 public: |
38 // Posts the given message and fills the buffer with the returned value. | 40 // Posts the given message and fills the buffer with the returned value. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 // Post the message using the scm, and do some processing on the returned | 110 // Post the message using the scm, and do some processing on the returned |
109 // headers. Decode the server response. | 111 // headers. Decode the server response. |
110 static bool PostAndProcessHeaders(browser_sync::ServerConnectionManager* scm, | 112 static bool PostAndProcessHeaders(browser_sync::ServerConnectionManager* scm, |
111 sessions::SyncSession* session, | 113 sessions::SyncSession* session, |
112 const ClientToServerMessage& msg, | 114 const ClientToServerMessage& msg, |
113 sync_pb::ClientToServerResponse* response); | 115 sync_pb::ClientToServerResponse* response); |
114 | 116 |
115 static base::TimeDelta GetThrottleDelay( | 117 static base::TimeDelta GetThrottleDelay( |
116 const sync_pb::ClientToServerResponse& response); | 118 const sync_pb::ClientToServerResponse& response); |
117 | 119 |
120 static void SyncerProtoUtil::HandleThrottling( | |
akalin
2011/11/21 20:04:26
remove SyncerProtoUtil::
lipalani1
2011/11/21 21:55:38
Done.
| |
121 const SyncProtocolError& error, | |
122 const base::TimeTicks& throttled_until, | |
123 sessions::SyncSessionContext* context, | |
124 sessions::SyncSession::Delegate* delegate); | |
125 | |
118 friend class SyncerProtoUtilTest; | 126 friend class SyncerProtoUtilTest; |
119 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, AddRequestBirthday); | 127 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, AddRequestBirthday); |
120 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, PostAndProcessHeaders); | 128 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, PostAndProcessHeaders); |
121 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); | 129 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, VerifyResponseBirthday); |
130 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingNoDatatypes); | |
131 FRIEND_TEST_ALL_PREFIXES(SyncerProtoUtilTest, HandleThrottlingWithDatatypes); | |
122 | 132 |
123 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); | 133 DISALLOW_COPY_AND_ASSIGN(SyncerProtoUtil); |
124 }; | 134 }; |
125 | 135 |
126 } // namespace browser_sync | 136 } // namespace browser_sync |
127 | 137 |
128 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ | 138 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_PROTO_UTIL_H_ |
OLD | NEW |