Chromium Code Reviews| Index: sync/engine/traffic_logger.h |
| diff --git a/sync/engine/traffic_logger.h b/sync/engine/traffic_logger.h |
| index 5cb8ffa81b4a3abec1d301d1522ab4bbd921e315..6e98d28411b3c04576e2c56613b92bd17984a1ed 100644 |
| --- a/sync/engine/traffic_logger.h |
| +++ b/sync/engine/traffic_logger.h |
| @@ -10,6 +10,8 @@ |
| #define CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_LOGGER_H_ |
| #pragma once |
| +#include <string> |
| + |
| namespace sync_pb { |
| class ClientToServerResponse; |
| class ClientToServerMessage; |
| @@ -17,9 +19,35 @@ class ClientToServerMessage; |
| namespace browser_sync { |
| -void LogClientToServerMessage(const sync_pb::ClientToServerMessage& msg); |
| +namespace sessions { |
| +class SyncSession; |
| +} // namespace sessions |
| + |
| +enum TrafficMessageType { |
| + CLIENT_TO_SERVER_MESSAGE, |
| + CLIENT_TO_SERVER_RESPONSE |
| +}; |
| + |
| +struct TrafficRecord { |
| + // The serialized message. |
| + std::string message; |
| + TrafficMessageType message_type; |
| + // If the message is too big to be kept in memory then it would be trucated. |
| + // For now the entire message would be truncated if it is big. |
| + // TODO(lipalani): Truncate the specifics to fit with in size. |
| + bool truncated; |
| + public: |
|
akalin
2012/03/22 20:27:28
no 'public'; everything in a struct is public by d
lipalani1
2012/03/23 00:03:11
Done.
|
| + TrafficRecord(const std::string& message, |
| + TrafficMessageType message_type, |
| + bool truncated); |
|
akalin
2012/03/22 20:27:28
you should also define the default constructor (an
lipalani1
2012/03/23 00:03:11
Done.
|
| + ~TrafficRecord(); |
| +}; |
| + |
| +void LogClientToServerMessage(const sync_pb::ClientToServerMessage& msg, |
|
akalin
2012/03/22 20:27:28
hmm I don't think the storing logic belongs in thi
lipalani1
2012/03/23 00:03:11
The context object for the most part has only gett
akalin
2012/03/23 00:58:50
I think the problem is that you take 'log' to mean
lipalani1
2012/03/26 21:25:21
Done.
akalin
2012/03/27 18:18:45
I meant a separate class for *just* storing/record
|
| + sessions::SyncSession* session); |
| void LogClientToServerResponse( |
| - const sync_pb::ClientToServerResponse& response); |
| + const sync_pb::ClientToServerResponse& response, |
| + sessions::SyncSession* session); |
| } // namespace browser_sync |