| 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 #include "sync/engine/traffic_recorder.h" | 5 #include "sync/engine/traffic_recorder.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "sync/protocol/proto_value_conversions.h" | 11 #include "sync/protocol/proto_value_conversions.h" |
| 12 #include "sync/protocol/sync.pb.h" | 12 #include "sync/protocol/sync.pb.h" |
| 13 #include "sync/sessions/sync_session.h" | 13 #include "sync/sessions/sync_session.h" |
| 14 | 14 |
| 15 namespace csync { | 15 namespace syncer { |
| 16 | 16 |
| 17 TrafficRecorder::TrafficRecord::TrafficRecord(const std::string& message, | 17 TrafficRecorder::TrafficRecord::TrafficRecord(const std::string& message, |
| 18 TrafficMessageType message_type, | 18 TrafficMessageType message_type, |
| 19 bool truncated) : | 19 bool truncated) : |
| 20 message(message), | 20 message(message), |
| 21 message_type(message_type), | 21 message_type(message_type), |
| 22 truncated(truncated) { | 22 truncated(truncated) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 TrafficRecorder::TrafficRecord::TrafficRecord() | 25 TrafficRecorder::TrafficRecord::TrafficRecord() |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void TrafficRecorder::RecordClientToServerMessage( | 122 void TrafficRecorder::RecordClientToServerMessage( |
| 123 const sync_pb::ClientToServerMessage& msg) { | 123 const sync_pb::ClientToServerMessage& msg) { |
| 124 StoreProtoInQueue(msg, CLIENT_TO_SERVER_MESSAGE); | 124 StoreProtoInQueue(msg, CLIENT_TO_SERVER_MESSAGE); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void TrafficRecorder::RecordClientToServerResponse( | 127 void TrafficRecorder::RecordClientToServerResponse( |
| 128 const sync_pb::ClientToServerResponse& response) { | 128 const sync_pb::ClientToServerResponse& response) { |
| 129 StoreProtoInQueue(response, CLIENT_TO_SERVER_RESPONSE); | 129 StoreProtoInQueue(response, CLIENT_TO_SERVER_RESPONSE); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace csync | 132 } // namespace syncer |
| 133 | 133 |
| OLD | NEW |