summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/ios/grit_whitelist.txt2
-rw-r--r--chrome/browser/resources/sync_internals/chrome_sync.js3
-rw-r--r--chrome/browser/resources/sync_internals/sync_index.html8
-rw-r--r--chrome/browser/resources/sync_internals/traffic.html8
-rw-r--r--chrome/browser/resources/sync_internals/traffic.js22
-rw-r--r--chrome/browser/resources/sync_internals_resources.grd1
-rw-r--r--chrome/browser/ui/webui/sync_internals_message_handler.cc1
-rw-r--r--chrome/browser/ui/webui/sync_internals_ui.cc1
-rw-r--r--sync/engine/sync_scheduler_unittest.cc2
-rw-r--r--sync/engine/syncer_proto_util.cc4
-rw-r--r--sync/engine/syncer_unittest.cc7
-rw-r--r--sync/engine/traffic_recorder.cc143
-rw-r--r--sync/engine/traffic_recorder.h86
-rw-r--r--sync/engine/traffic_recorder_unittest.cc123
-rw-r--r--sync/internal_api/internal_components_factory_impl.cc2
-rw-r--r--sync/internal_api/public/internal_components_factory.h2
-rw-r--r--sync/internal_api/public/internal_components_factory_impl.h1
-rw-r--r--sync/internal_api/public/test/test_internal_components_factory.h1
-rw-r--r--sync/internal_api/sync_manager_impl.cc18
-rw-r--r--sync/internal_api/sync_manager_impl.h3
-rw-r--r--sync/internal_api/test/test_internal_components_factory.cc2
-rw-r--r--sync/sessions/sync_session_context.cc2
-rw-r--r--sync/sessions/sync_session_context.h8
-rw-r--r--sync/sync_core.gypi2
-rw-r--r--sync/sync_tests.gypi1
25 files changed, 3 insertions, 450 deletions
diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt
index 666af97..0a30875 100644
--- a/build/ios/grit_whitelist.txt
+++ b/build/ios/grit_whitelist.txt
@@ -53,12 +53,10 @@ IDR_SYNC_INTERNALS_DATA_JS
IDR_SYNC_INTERNALS_EVENTS_JS
IDR_SYNC_INTERNALS_INDEX_HTML
IDR_SYNC_INTERNALS_INDEX_JS
-IDR_SYNC_INTERNALS_NOTIFICATIONS_JS
IDR_SYNC_INTERNALS_SEARCH_JS
IDR_SYNC_INTERNALS_SYNC_LOG_JS
IDR_SYNC_INTERNALS_SYNC_NODE_BROWSER_JS
IDR_SYNC_INTERNALS_SYNC_SEARCH_JS
-IDR_SYNC_INTERNALS_TRAFFIC_JS
IDR_THROBBER
IDR_TRANSLATE_JS
IDR_UPDATE_BADGE4
diff --git a/chrome/browser/resources/sync_internals/chrome_sync.js b/chrome/browser/resources/sync_internals/chrome_sync.js
index f59c2bd..f8d9a2f 100644
--- a/chrome/browser/resources/sync_internals/chrome_sync.js
+++ b/chrome/browser/resources/sync_internals/chrome_sync.js
@@ -34,9 +34,6 @@ cr.define('chrome.sync', function() {
}
var syncFunctions = [
- // Client server communication logging functions.
- 'getClientServerTraffic',
-
// Get an array containing a JSON representations of all known sync nodes.
'getAllNodes',
];
diff --git a/chrome/browser/resources/sync_internals/sync_index.html b/chrome/browser/resources/sync_internals/sync_index.html
index a6241af..e59c761 100644
--- a/chrome/browser/resources/sync_internals/sync_index.html
+++ b/chrome/browser/resources/sync_internals/sync_index.html
@@ -46,10 +46,6 @@ chrome/test/functional/special_tabs.py. -->
same height no matter which tab is selected. */
min-height: 650px;
}
-
-#traffic-dump {
- font-size: 120%;
-}
</style>
<tabbox id="sync-page">
@@ -59,7 +55,6 @@ chrome/test/functional/special_tabs.py. -->
<tab id="sync-events-tab">Events</tab>
<tab id="sync-browser-tab">Sync Node Browser</tab>
<tab id="sync-search-tab">Search</tab>
- <tab id="sync-traffic-tab">Traffic</tab>
</tabs>
<tabpanels>
<tabpanel>
@@ -77,9 +72,6 @@ chrome/test/functional/special_tabs.py. -->
<tabpanel>
<include src="search.html" />
</tabpanel>
- <tabpanel>
- <include src="traffic.html" />
- </tabpanel>
</tabpanels>
</tabbox>
diff --git a/chrome/browser/resources/sync_internals/traffic.html b/chrome/browser/resources/sync_internals/traffic.html
deleted file mode 100644
index 73b2410..0000000
--- a/chrome/browser/resources/sync_internals/traffic.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<p><strong>Some personal info may be in the data dump. Be
-careful about posting data dumps on bug reports.</strong></p>
-
-<button id="traffic-to-text">Dump client server traffic to text</button>
-
-<pre id="traffic-dump"></pre>
-
-<script src="chrome://sync-internals/traffic.js"></script>
diff --git a/chrome/browser/resources/sync_internals/traffic.js b/chrome/browser/resources/sync_internals/traffic.js
deleted file mode 100644
index 2e56fb5..0000000
--- a/chrome/browser/resources/sync_internals/traffic.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function() {
- var trafficToTextButton = document.getElementById('traffic-to-text');
- var trafficDump = document.getElementById('traffic-dump');
- trafficToTextButton.addEventListener('click', function(event) {
- chrome.sync.getClientServerTraffic(printData);
-});
-
-function printData(trafficRecord) {
- var trafficData = '';
- trafficData += '===\n';
- trafficData += 'Client Server Traffic\n';
- trafficData += '===\n';
- trafficData += JSON.stringify(trafficRecord, null, 2);
- trafficData += '\n';
-
- trafficDump.textContent = trafficData;
-}
-})();
diff --git a/chrome/browser/resources/sync_internals_resources.grd b/chrome/browser/resources/sync_internals_resources.grd
index 9d1f349..10f003c 100644
--- a/chrome/browser/resources/sync_internals_resources.grd
+++ b/chrome/browser/resources/sync_internals_resources.grd
@@ -21,7 +21,6 @@
<include name="IDR_SYNC_INTERNALS_DATA_JS" file="sync_internals/data.js" type="BINDATA" />
<include name="IDR_SYNC_INTERNALS_EVENTS_JS" file="sync_internals/events.js" type="BINDATA" />
<include name="IDR_SYNC_INTERNALS_SEARCH_JS" file="sync_internals/search.js" type="BINDATA" />
- <include name="IDR_SYNC_INTERNALS_TRAFFIC_JS" file="sync_internals/traffic.js" type="BINDATA" />
</includes>
</release>
</grit>
diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals_message_handler.cc
index 3896a42..93ba008 100644
--- a/chrome/browser/ui/webui/sync_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/sync_internals_message_handler.cc
@@ -57,7 +57,6 @@ void SyncInternalsMessageHandler::RegisterMessages() {
base::Unretained(this)));
RegisterJsControllerCallback("getAllNodes");
- RegisterJsControllerCallback("getClientServerTraffic");
}
void SyncInternalsMessageHandler::HandleRegisterForEvents(
diff --git a/chrome/browser/ui/webui/sync_internals_ui.cc b/chrome/browser/ui/webui/sync_internals_ui.cc
index 280c866..cc5a7aa 100644
--- a/chrome/browser/ui/webui/sync_internals_ui.cc
+++ b/chrome/browser/ui/webui/sync_internals_ui.cc
@@ -32,7 +32,6 @@ content::WebUIDataSource* CreateSyncInternalsHTMLSource() {
source->AddResourcePath("data.js", IDR_SYNC_INTERNALS_DATA_JS);
source->AddResourcePath("events.js", IDR_SYNC_INTERNALS_EVENTS_JS);
source->AddResourcePath("search.js", IDR_SYNC_INTERNALS_SEARCH_JS);
- source->AddResourcePath("traffic.js", IDR_SYNC_INTERNALS_TRAFFIC_JS);
source->SetDefaultResource(IDR_SYNC_INTERNALS_INDEX_HTML);
return source;
}
diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc
index 45ebf19..c231087 100644
--- a/sync/engine/sync_scheduler_unittest.cc
+++ b/sync/engine/sync_scheduler_unittest.cc
@@ -135,7 +135,7 @@ class SyncSchedulerTest : public testing::Test {
context_.reset(new SyncSessionContext(
connection_.get(), directory(),
extensions_activity_.get(),
- std::vector<SyncEngineEventListener*>(), NULL, NULL,
+ std::vector<SyncEngineEventListener*>(), NULL,
model_type_registry_.get(),
true, // enable keystore encryption
false, // force enable pre-commit GU avoidance
diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc
index d6fb8d5..dab228f 100644
--- a/sync/engine/syncer_proto_util.cc
+++ b/sync/engine/syncer_proto_util.cc
@@ -358,7 +358,6 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage(
syncable::Directory* dir = session->context()->directory();
LogClientToServerMessage(*msg);
- session->context()->traffic_recorder()->RecordClientToServerMessage(*msg);
if (!PostAndProcessHeaders(session->context()->connection_manager(), session,
*msg, response)) {
// There was an error establishing communication with the server.
@@ -371,10 +370,7 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage(
return ServerConnectionErrorAsSyncerError(server_status);
}
-
LogClientToServerResponse(*response);
- session->context()->traffic_recorder()->RecordClientToServerResponse(
- *response);
// Persist a bag of chips if it has been sent by the server.
PersistBagOfChips(dir, *response);
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index 7a3afe3..72972a4 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -28,7 +28,6 @@
#include "sync/engine/sync_scheduler_impl.h"
#include "sync/engine/syncer.h"
#include "sync/engine/syncer_proto_util.h"
-#include "sync/engine/traffic_recorder.h"
#include "sync/internal_api/public/base/cancelation_signal.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/engine/model_safe_worker.h"
@@ -118,8 +117,7 @@ class SyncerTest : public testing::Test,
: extensions_activity_(new ExtensionsActivity),
syncer_(NULL),
saw_syncer_event_(false),
- last_client_invalidation_hint_buffer_size_(10),
- traffic_recorder_(0, 0) {
+ last_client_invalidation_hint_buffer_size_(10) {
}
// SyncSession::Delegate implementation.
@@ -231,7 +229,7 @@ class SyncerTest : public testing::Test,
new SyncSessionContext(
mock_server_.get(), directory(),
extensions_activity_,
- listeners, debug_info_getter_.get(), &traffic_recorder_,
+ listeners, debug_info_getter_.get(),
model_type_registry_.get(),
true, // enable keystore encryption
false, // force enable pre-commit GU avoidance experiment
@@ -511,7 +509,6 @@ class SyncerTest : public testing::Test,
std::vector<scoped_refptr<ModelSafeWorker> > workers_;
ModelTypeSet enabled_datatypes_;
- TrafficRecorder traffic_recorder_;
sessions::NudgeTracker nudge_tracker_;
scoped_ptr<MockDebugInfoGetter> debug_info_getter_;
diff --git a/sync/engine/traffic_recorder.cc b/sync/engine/traffic_recorder.cc
deleted file mode 100644
index d3f2347..0000000
--- a/sync/engine/traffic_recorder.cc
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/engine/traffic_recorder.h"
-
-#include "base/json/json_writer.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/values.h"
-#include "sync/protocol/proto_value_conversions.h"
-#include "sync/protocol/sync.pb.h"
-#include "sync/sessions/sync_session.h"
-#include "sync/util/time.h"
-
-namespace syncer {
-
-// Return current time.
-base::Time TrafficRecorder::GetTime() {
- return base::Time::Now();
-}
-
-TrafficRecorder::TrafficRecord::TrafficRecord(const std::string& message,
- TrafficMessageType message_type,
- bool truncated,
- base::Time time) :
- message(message),
- message_type(message_type),
- truncated(truncated),
- timestamp(time) {
-}
-
-TrafficRecorder::TrafficRecord::TrafficRecord()
- : message_type(UNKNOWN_MESSAGE_TYPE),
- truncated(false) {
-}
-
-TrafficRecorder::TrafficRecord::~TrafficRecord() {
-}
-
-TrafficRecorder::TrafficRecorder(unsigned int max_messages,
- unsigned int max_message_size)
- : max_messages_(max_messages),
- max_message_size_(max_message_size) {
-}
-
-TrafficRecorder::~TrafficRecorder() {
-}
-
-namespace {
-const char* GetMessageTypeString(TrafficRecorder::TrafficMessageType type) {
- switch(type) {
- case TrafficRecorder::CLIENT_TO_SERVER_MESSAGE:
- return "Request";
- case TrafficRecorder::CLIENT_TO_SERVER_RESPONSE:
- return "Response";
- default:
- NOTREACHED();
- return "";
- }
-}
-}
-
-base::DictionaryValue* TrafficRecorder::TrafficRecord::ToValue() const {
- scoped_ptr<base::DictionaryValue> value;
- if (truncated) {
- value.reset(new base::DictionaryValue());
- value->SetString("message_type",
- GetMessageTypeString(message_type));
- value->SetBoolean("truncated", true);
- } else if (message_type == TrafficRecorder::CLIENT_TO_SERVER_MESSAGE) {
- sync_pb::ClientToServerMessage message_proto;
- if (message_proto.ParseFromString(message))
- value.reset(
- ClientToServerMessageToValue(message_proto,
- false /* include_specifics */));
- } else if (message_type == TrafficRecorder::CLIENT_TO_SERVER_RESPONSE) {
- sync_pb::ClientToServerResponse message_proto;
- if (message_proto.ParseFromString(message))
- value.reset(
- ClientToServerResponseToValue(message_proto,
- false /* include_specifics */));
- } else {
- NOTREACHED();
- }
-
- value->SetString("timestamp", GetTimeDebugString(timestamp));
-
- return value.release();
-}
-
-
-base::ListValue* TrafficRecorder::ToValue() const {
- scoped_ptr<base::ListValue> value(new base::ListValue());
- std::deque<TrafficRecord>::const_iterator it;
- for (it = records_.begin(); it != records_.end(); ++it) {
- const TrafficRecord& record = *it;
- value->Append(record.ToValue());
- }
-
- return value.release();
-}
-
-
-void TrafficRecorder::AddTrafficToQueue(TrafficRecord* record) {
- records_.resize(records_.size() + 1);
- std::swap(records_.back(), *record);
-
- // We might have more records than our limit.
- // Maintain the size invariant by deleting items.
- while (records_.size() > max_messages_) {
- records_.pop_front();
- }
-}
-
-void TrafficRecorder::StoreProtoInQueue(
- const ::google::protobuf::MessageLite& msg,
- TrafficMessageType type) {
- bool truncated = false;
- std::string message;
- if (static_cast<unsigned int>(msg.ByteSize()) >= max_message_size_) {
- // TODO(lipalani): Trim the specifics to fit in size.
- truncated = true;
- } else {
- msg.SerializeToString(&message);
- }
-
- TrafficRecord record(message, type, truncated, GetTime());
- AddTrafficToQueue(&record);
-}
-
-void TrafficRecorder::RecordClientToServerMessage(
- const sync_pb::ClientToServerMessage& msg) {
- StoreProtoInQueue(msg, CLIENT_TO_SERVER_MESSAGE);
-}
-
-void TrafficRecorder::RecordClientToServerResponse(
- const sync_pb::ClientToServerResponse& response) {
- StoreProtoInQueue(response, CLIENT_TO_SERVER_RESPONSE);
-}
-
-} // namespace syncer
-
diff --git a/sync/engine/traffic_recorder.h b/sync/engine/traffic_recorder.h
deleted file mode 100644
index 55ee0b3..0000000
--- a/sync/engine/traffic_recorder.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_
-#define CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_
-
-#include <deque>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/gtest_prod_util.h"
-#include "base/time/time.h"
-#include "base/values.h"
-#include "sync/base/sync_export.h"
-#include "sync/protocol/sync.pb.h"
-
-namespace sync_pb {
-class ClientToServerResponse;
-class ClientToServerMessage;
-}
-
-namespace syncer {
-
-class SYNC_EXPORT_PRIVATE TrafficRecorder {
- public:
- enum TrafficMessageType {
- CLIENT_TO_SERVER_MESSAGE,
- CLIENT_TO_SERVER_RESPONSE,
- UNKNOWN_MESSAGE_TYPE
- };
-
- struct SYNC_EXPORT_PRIVATE TrafficRecord {
- // The serialized message.
- std::string message;
- TrafficMessageType message_type;
- // If the message is too big to be kept in memory then it should be
- // truncated. For now the entire message is omitted if it is too big.
- // TODO(lipalani): Truncate the specifics to fit within size.
- bool truncated;
-
- TrafficRecord(const std::string& message,
- TrafficMessageType message_type,
- bool truncated,
- base::Time time);
- TrafficRecord();
- ~TrafficRecord();
- base::DictionaryValue* ToValue() const;
-
- // Time of record creation.
- base::Time timestamp;
- };
-
- TrafficRecorder(unsigned int max_messages, unsigned int max_message_size);
- virtual ~TrafficRecorder();
-
- void RecordClientToServerMessage(const sync_pb::ClientToServerMessage& msg);
- void RecordClientToServerResponse(
- const sync_pb::ClientToServerResponse& response);
- base::ListValue* ToValue() const;
-
- const std::deque<TrafficRecord>& records() {
- return records_;
- }
-
- private:
- void AddTrafficToQueue(TrafficRecord* record);
- void StoreProtoInQueue(const ::google::protobuf::MessageLite& msg,
- TrafficMessageType type);
-
- // Method to get record creation time.
- virtual base::Time GetTime();
-
- // Maximum number of messages stored in the queue.
- unsigned int max_messages_;
-
- // Maximum size of each message.
- unsigned int max_message_size_;
- std::deque<TrafficRecord> records_;
- DISALLOW_COPY_AND_ASSIGN(TrafficRecorder);
-};
-
-} // namespace syncer
-
-#endif // CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_
-
diff --git a/sync/engine/traffic_recorder_unittest.cc b/sync/engine/traffic_recorder_unittest.cc
deleted file mode 100644
index 363a3c8..0000000
--- a/sync/engine/traffic_recorder_unittest.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/engine/traffic_recorder.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "base/time/time.h"
-#include "base/values.h"
-#include "sync/protocol/sync.pb.h"
-#include "sync/util/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-
-const unsigned int kMaxMessages = 10;
-const unsigned int kMaxMessageSize = 5 * 1024;
-
-// Ensure the number of records don't exceed |kMaxMessages|.
-TEST(TrafficRecorderTest, MaxRecordsTest) {
- TrafficRecorder recorder(kMaxMessages, kMaxMessageSize);
- sync_pb::ClientToServerResponse response;
-
- for (unsigned int i = 0; i < 2*kMaxMessages; ++i)
- recorder.RecordClientToServerResponse(response);
-
- EXPECT_EQ(recorder.records().size(), kMaxMessages);
-}
-
-// Ensure records with size greater than |kMaxMessageSize| are truncated.
-TEST(TrafficRecorderTest, MaxMessageSizeTest) {
- sync_pb::ClientToServerResponse response;
-
- sync_pb::ClientToServerResponse::Error* error = response.mutable_error();
- std::string error_description(kMaxMessageSize * 2, 'a');
- error->set_error_description(error_description);
-
- TrafficRecorder recorder(kMaxMessages, kMaxMessageSize);
- recorder.RecordClientToServerResponse(response);
-
- TrafficRecorder::TrafficRecord record = recorder.records().front();
- EXPECT_TRUE(record.truncated);
- EXPECT_TRUE(record.message.empty());
-}
-
-// Test implementation of TrafficRecorder.
-class TestTrafficRecorder : public TrafficRecorder {
- public:
- TestTrafficRecorder(unsigned int max_messages, unsigned int max_message_size)
- : TrafficRecorder(max_messages, max_message_size) {
- set_time(0);
- }
- virtual ~TestTrafficRecorder() {}
-
- virtual base::Time GetTime() OVERRIDE {
- return time_;
- }
-
- void set_time(int64 time) {
- time_ = ProtoTimeToTime(time);
- }
-
- void set_time(base::Time time) {
- time_ = time;
- }
-
- private:
- base::Time time_;
-};
-
-// Ensure that timestamp is recorded correctly in traffic record.
-TEST(TrafficRecorderTest, TimestampTest) {
- sync_pb::ClientToServerResponse response;
-
- TestTrafficRecorder recorder(kMaxMessages, kMaxMessageSize);
- recorder.set_time(3);
- recorder.RecordClientToServerResponse(response);
-
- base::Time expect_time = ProtoTimeToTime(3);
- TrafficRecorder::TrafficRecord record = recorder.records().front();
- EXPECT_EQ(expect_time, record.timestamp);
-}
-
-// Ensure that timestamps are recorded correctly in traffic records.
-TEST(TrafficRecorderTest, MultipleTimestampTest) {
- sync_pb::ClientToServerResponse response;
- base::Time sample_time_1 = ProtoTimeToTime(GG_INT64_C(1359484676659));
- base::Time sample_time_2 = ProtoTimeToTime(GG_INT64_C(135948467665932));
-
- TestTrafficRecorder recorder(kMaxMessages, kMaxMessageSize);
- recorder.set_time(sample_time_1);
- recorder.RecordClientToServerResponse(response);
- recorder.set_time(sample_time_2);
- recorder.RecordClientToServerResponse(response);
-
- TrafficRecorder::TrafficRecord record_1 = recorder.records().front();
- TrafficRecorder::TrafficRecord record_2 = recorder.records().back();
- EXPECT_EQ(sample_time_1, record_1.timestamp);
- EXPECT_EQ(sample_time_2, record_2.timestamp);
-}
-
-// Ensure that timestamp is added to ListValue of DictionaryValues in ToValue().
-TEST(TrafficRecorderTest, ToValueTimestampTest) {
- sync_pb::ClientToServerResponse response;
- base::Time sample_time = ProtoTimeToTime(GG_INT64_C(135948467665932));
- std::string expect_time_str = GetTimeDebugString(sample_time);
-
- TestTrafficRecorder recorder(kMaxMessages, kMaxMessageSize);
- recorder.set_time(sample_time);
- recorder.RecordClientToServerResponse(response);
-
- scoped_ptr<base::ListValue> value;
- value.reset(recorder.ToValue());
-
- base::DictionaryValue* record_value;
- std::string time_str;
-
- ASSERT_TRUE(value->GetDictionary(0, &record_value));
- EXPECT_TRUE(record_value->GetString("timestamp", &time_str));
- EXPECT_EQ(expect_time_str, time_str);
-}
-
-} // namespace syncer
diff --git a/sync/internal_api/internal_components_factory_impl.cc b/sync/internal_api/internal_components_factory_impl.cc
index 11340a2..e764a16 100644
--- a/sync/internal_api/internal_components_factory_impl.cc
+++ b/sync/internal_api/internal_components_factory_impl.cc
@@ -44,14 +44,12 @@ InternalComponentsFactoryImpl::BuildContext(
ExtensionsActivity* extensions_activity,
const std::vector<SyncEngineEventListener*>& listeners,
sessions::DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
const std::string& invalidation_client_id) {
return scoped_ptr<sessions::SyncSessionContext>(
new sessions::SyncSessionContext(
connection_manager, directory, extensions_activity,
listeners, debug_info_getter,
- traffic_recorder,
model_type_registry,
switches_.encryption_method == ENCRYPTION_KEYSTORE,
switches_.pre_commit_updates_policy ==
diff --git a/sync/internal_api/public/internal_components_factory.h b/sync/internal_api/public/internal_components_factory.h
index 72ed94a..f43804a 100644
--- a/sync/internal_api/public/internal_components_factory.h
+++ b/sync/internal_api/public/internal_components_factory.h
@@ -24,7 +24,6 @@ class ModelTypeRegistry;
class ServerConnectionManager;
class SyncEngineEventListener;
class SyncScheduler;
-class TrafficRecorder;
namespace sessions {
class DebugInfoGetter;
@@ -86,7 +85,6 @@ class SYNC_EXPORT InternalComponentsFactory {
ExtensionsActivity* extensions_activity,
const std::vector<SyncEngineEventListener*>& listeners,
sessions::DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
const std::string& invalidator_client_id) = 0;
diff --git a/sync/internal_api/public/internal_components_factory_impl.h b/sync/internal_api/public/internal_components_factory_impl.h
index b6a3b2fc..7c364dc 100644
--- a/sync/internal_api/public/internal_components_factory_impl.h
+++ b/sync/internal_api/public/internal_components_factory_impl.h
@@ -30,7 +30,6 @@ class SYNC_EXPORT InternalComponentsFactoryImpl
ExtensionsActivity* extensions_activity,
const std::vector<SyncEngineEventListener*>& listeners,
sessions::DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
const std::string& invalidator_client_id) OVERRIDE;
diff --git a/sync/internal_api/public/test/test_internal_components_factory.h b/sync/internal_api/public/test/test_internal_components_factory.h
index 8730f50..3b7d3c5 100644
--- a/sync/internal_api/public/test/test_internal_components_factory.h
+++ b/sync/internal_api/public/test/test_internal_components_factory.h
@@ -36,7 +36,6 @@ class TestInternalComponentsFactory : public InternalComponentsFactory {
ExtensionsActivity* monitor,
const std::vector<SyncEngineEventListener*>& listeners,
sessions::DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
const std::string& invalidator_client_id) OVERRIDE;
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 7350066..0f30e65 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -65,10 +65,6 @@ static const int kPreferencesNudgeDelayMilliseconds = 2000;
static const int kSyncRefreshDelayMsec = 500;
static const int kSyncSchedulerDelayMsec = 250;
-// Maximum count and size for traffic recorder.
-static const unsigned int kMaxMessagesToRecord = 100;
-static const unsigned int kMaxMessageSizeToRecord = 50 * 1024;
-
GetUpdatesCallerInfo::GetUpdatesSource GetSourceFromReason(
ConfigureReason reason) {
switch (reason) {
@@ -172,7 +168,6 @@ SyncManagerImpl::SyncManagerImpl(const std::string& name)
initialized_(false),
observing_network_connectivity_changes_(false),
invalidator_state_(DEFAULT_INVALIDATION_ERROR),
- traffic_recorder_(kMaxMessagesToRecord, kMaxMessageSizeToRecord),
encryptor_(NULL),
report_unrecoverable_error_function_(NULL),
weak_ptr_factory_(this) {
@@ -186,9 +181,6 @@ SyncManagerImpl::SyncManagerImpl(const std::string& name)
BindJsMessageHandler(
"getAllNodes",
&SyncManagerImpl::GetAllNodes);
- BindJsMessageHandler(
- "getClientServerTraffic",
- &SyncManagerImpl::GetClientServerTraffic);
}
SyncManagerImpl::~SyncManagerImpl() {
@@ -424,7 +416,6 @@ void SyncManagerImpl::Init(
extensions_activity,
listeners,
&debug_info_event_listener_,
- &traffic_recorder_,
model_type_registry_.get(),
invalidator_client_id).Pass();
session_context_->set_account_name(credentials.email);
@@ -991,15 +982,6 @@ void SyncManagerImpl::BindJsMessageHandler(
base::Bind(unbound_message_handler, base::Unretained(this));
}
-JsArgList SyncManagerImpl::GetClientServerTraffic(
- const JsArgList& args) {
- base::ListValue return_args;
- base::ListValue* value = traffic_recorder_.ToValue();
- if (value != NULL)
- return_args.Append(value);
- return JsArgList(&return_args);
-}
-
JsArgList SyncManagerImpl::GetAllNodes(const JsArgList& args) {
ReadTransaction trans(FROM_HERE, GetUserShare());
base::ListValue return_args;
diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h
index 8219605..c8f9aed 100644
--- a/sync/internal_api/sync_manager_impl.h
+++ b/sync/internal_api/sync_manager_impl.h
@@ -13,7 +13,6 @@
#include "sync/engine/all_status.h"
#include "sync/engine/net/server_connection_manager.h"
#include "sync/engine/sync_engine_event_listener.h"
-#include "sync/engine/traffic_recorder.h"
#include "sync/internal_api/change_reorder_buffer.h"
#include "sync/internal_api/debug_info_event_listener.h"
#include "sync/internal_api/js_mutation_event_observer.h"
@@ -276,7 +275,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
JsArgList GetNodeSummariesById(const JsArgList& args);
JsArgList GetNodeDetailsById(const JsArgList& args);
JsArgList GetChildNodeIds(const JsArgList& args);
- JsArgList GetClientServerTraffic(const JsArgList& args);
syncable::Directory* directory();
@@ -362,7 +360,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl :
DebugInfoEventListener debug_info_event_listener_;
ProtocolEventBuffer protocol_event_buffer_;
- TrafficRecorder traffic_recorder_;
Encryptor* encryptor_;
scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler_;
diff --git a/sync/internal_api/test/test_internal_components_factory.cc b/sync/internal_api/test/test_internal_components_factory.cc
index 2f1367f..c7d94e9 100644
--- a/sync/internal_api/test/test_internal_components_factory.cc
+++ b/sync/internal_api/test/test_internal_components_factory.cc
@@ -35,7 +35,6 @@ TestInternalComponentsFactory::BuildContext(
ExtensionsActivity* monitor,
const std::vector<SyncEngineEventListener*>& listeners,
sessions::DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
const std::string& invalidator_client_id) {
@@ -45,7 +44,6 @@ TestInternalComponentsFactory::BuildContext(
new sessions::SyncSessionContext(
connection_manager, directory, monitor,
empty_listeners, debug_info_getter,
- traffic_recorder,
model_type_registry,
switches_.encryption_method == ENCRYPTION_KEYSTORE,
switches_.pre_commit_updates_policy ==
diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc
index 54ae473..39ae427 100644
--- a/sync/sessions/sync_session_context.cc
+++ b/sync/sessions/sync_session_context.cc
@@ -16,7 +16,6 @@ SyncSessionContext::SyncSessionContext(
ExtensionsActivity* extensions_activity,
const std::vector<SyncEngineEventListener*>& listeners,
DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
bool keystore_encryption_enabled,
bool client_enabled_pre_commit_update_avoidance,
@@ -27,7 +26,6 @@ SyncSessionContext::SyncSessionContext(
notifications_enabled_(false),
max_commit_batch_size_(kDefaultMaxCommitBatchSize),
debug_info_getter_(debug_info_getter),
- traffic_recorder_(traffic_recorder),
model_type_registry_(model_type_registry),
keystore_encryption_enabled_(keystore_encryption_enabled),
invalidator_client_id_(invalidator_client_id),
diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h
index c7661ce..7fa4173 100644
--- a/sync/sessions/sync_session_context.h
+++ b/sync/sessions/sync_session_context.h
@@ -19,7 +19,6 @@
#include "sync/base/sync_export.h"
#include "sync/engine/sync_engine_event_listener.h"
-#include "sync/engine/traffic_recorder.h"
#include "sync/sessions/debug_info_getter.h"
#include "sync/sessions/model_type_registry.h"
@@ -47,7 +46,6 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
ExtensionsActivity* extensions_activity,
const std::vector<SyncEngineEventListener*>& listeners,
DebugInfoGetter* debug_info_getter,
- TrafficRecorder* traffic_recorder,
ModelTypeRegistry* model_type_registry,
bool keystore_encryption_enabled,
bool client_enabled_pre_commit_update_avoidance,
@@ -96,10 +94,6 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
return &listeners_;
}
- TrafficRecorder* traffic_recorder() {
- return traffic_recorder_;
- }
-
bool keystore_encryption_enabled() const {
return keystore_encryption_enabled_;
}
@@ -158,8 +152,6 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
// client behavior on server side.
DebugInfoGetter* const debug_info_getter_;
- TrafficRecorder* traffic_recorder_;
-
ModelTypeRegistry* model_type_registry_;
// Satus information to be sent up to the server.
diff --git a/sync/sync_core.gypi b/sync/sync_core.gypi
index 5ca59ee5..0c263cb 100644
--- a/sync/sync_core.gypi
+++ b/sync/sync_core.gypi
@@ -87,8 +87,6 @@
'engine/sync_scheduler_impl.h',
'engine/traffic_logger.cc',
'engine/traffic_logger.h',
- 'engine/traffic_recorder.cc',
- 'engine/traffic_recorder.h',
'engine/update_applicator.cc',
'engine/update_applicator.h',
'engine/update_handler.cc',
diff --git a/sync/sync_tests.gypi b/sync/sync_tests.gypi
index 5fc0087..f5c5301 100644
--- a/sync/sync_tests.gypi
+++ b/sync/sync_tests.gypi
@@ -291,7 +291,6 @@
'engine/sync_scheduler_unittest.cc',
'engine/syncer_proto_util_unittest.cc',
'engine/syncer_unittest.cc',
- 'engine/traffic_recorder_unittest.cc',
'js/js_arg_list_unittest.cc',
'js/js_event_details_unittest.cc',
'js/sync_js_controller_unittest.cc',