diff options
23 files changed, 13 insertions, 429 deletions
diff --git a/chrome/browser/sync/engine/download_updates_command.cc b/chrome/browser/sync/engine/download_updates_command.cc index 5ca2290..7677989 100644 --- a/chrome/browser/sync/engine/download_updates_command.cc +++ b/chrome/browser/sync/engine/download_updates_command.cc @@ -16,8 +16,6 @@ using syncable::ScopedDirLookup; -using sync_pb::DebugInfo; - namespace browser_sync { using sessions::StatusController; using sessions::SyncSession; @@ -85,10 +83,6 @@ void DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) { SyncerProtoUtil::AddRequestBirthday(dir, &client_to_server_message); - DebugInfo* debug_info = client_to_server_message.mutable_debug_info(); - - AppendClientDebugInfoIfNeeded(session, debug_info); - bool ok = SyncerProtoUtil::PostClientToServerMessage( client_to_server_message, &update_response, @@ -132,21 +126,4 @@ void DownloadUpdatesCommand::SetRequestedTypes( DCHECK_LT(0, requested_type_count) << "Doing GetUpdates with empty filter."; } -void DownloadUpdatesCommand::AppendClientDebugInfoIfNeeded( - sessions::SyncSession* session, - DebugInfo* debug_info) { - // We want to send the debug info only once per sync cycle. Check if it has - // already been sent. - if (!session->status_controller()->debug_info_sent()) { - VLOG(1) << "Sending client debug info ..."; - // could be null in some unit tests. - if (session->context()->debug_info_getter()) { - session->context()->debug_info_getter()->GetAndClearDebugInfo( - debug_info); - } - session->status_controller()->set_debug_info_sent(); - } -} - - } // namespace browser_sync diff --git a/chrome/browser/sync/engine/download_updates_command.h b/chrome/browser/sync/engine/download_updates_command.h index c782c97..713f03b 100644 --- a/chrome/browser/sync/engine/download_updates_command.h +++ b/chrome/browser/sync/engine/download_updates_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2009 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. @@ -7,10 +7,8 @@ #pragma once #include "base/basictypes.h" -#include "base/gtest_prod_util.h" #include "chrome/browser/sync/engine/model_safe_worker.h" #include "chrome/browser/sync/engine/syncer_command.h" -#include "chrome/browser/sync/protocol/sync.pb.h" #include "chrome/browser/sync/syncable/model_type.h" namespace sync_pb { @@ -49,9 +47,6 @@ class DownloadUpdatesCommand : public SyncerCommand { sync_pb::EntitySpecifics* filter_protobuf); private: - FRIEND_TEST_ALL_PREFIXES(DownloadUpdatesCommandTest, VerifyAppendDebugInfo); - void AppendClientDebugInfoIfNeeded(sessions::SyncSession* session, - sync_pb::DebugInfo* debug_info); DISALLOW_COPY_AND_ASSIGN(DownloadUpdatesCommand); }; diff --git a/chrome/browser/sync/engine/download_updates_command_unittest.cc b/chrome/browser/sync/engine/download_updates_command_unittest.cc index 0373195..1e2aa2f 100644 --- a/chrome/browser/sync/engine/download_updates_command_unittest.cc +++ b/chrome/browser/sync/engine/download_updates_command_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -11,7 +11,6 @@ #include "chrome/browser/sync/test/engine/proto_extension_validator.h" #include "chrome/browser/sync/test/engine/syncer_command_test.h" -using ::testing::_; namespace browser_sync { using syncable::FIRST_REAL_MODEL_TYPE; @@ -133,15 +132,4 @@ TEST_F(DownloadUpdatesCommandTest, ExecuteWithPayloads) { command_.ExecuteImpl(session(source)); } -TEST_F(DownloadUpdatesCommandTest, VerifyAppendDebugInfo) { - sync_pb::DebugInfo debug_info; - EXPECT_CALL(*(mock_debug_info_getter()), GetAndClearDebugInfo(_)) - .Times(1); - command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); - - // Now try to add it once more and make sure |GetAndClearDebugInfo| is not - // called. - command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); -} - } // namespace browser_sync diff --git a/chrome/browser/sync/engine/sync_scheduler_unittest.cc b/chrome/browser/sync/engine/sync_scheduler_unittest.cc index df06248..782ceea 100644 --- a/chrome/browser/sync/engine/sync_scheduler_unittest.cc +++ b/chrome/browser/sync/engine/sync_scheduler_unittest.cc @@ -96,7 +96,7 @@ class SyncSchedulerTest : public testing::Test { connection_.reset(new MockConnectionManager(syncdb_.manager(), "Test")); connection_->SetServerReachable(); context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), - registrar_.get(), std::vector<SyncEngineEventListener*>(), NULL); + registrar_.get(), std::vector<SyncEngineEventListener*>()); context_->set_notifications_enabled(true); context_->set_account_name("Test"); scheduler_.reset( diff --git a/chrome/browser/sync/engine/sync_scheduler_whitebox_unittest.cc b/chrome/browser/sync/engine/sync_scheduler_whitebox_unittest.cc index eaffc0e..2a581b2 100644 --- a/chrome/browser/sync/engine/sync_scheduler_whitebox_unittest.cc +++ b/chrome/browser/sync/engine/sync_scheduler_whitebox_unittest.cc @@ -29,7 +29,7 @@ class SyncSchedulerWhiteboxTest : public testing::Test { connection_.reset(new MockConnectionManager(syncdb_.manager(), "Test")); connection_->SetServerReachable(); context_ = new SyncSessionContext(connection_.get(), syncdb_.manager(), - registrar_.get(), std::vector<SyncEngineEventListener*>(), NULL); + registrar_.get(), std::vector<SyncEngineEventListener*>()); context_->set_notifications_enabled(true); context_->set_account_name("Test"); scheduler_.reset( diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc index 241526c..2310b36 100644 --- a/chrome/browser/sync/engine/syncer_unittest.cc +++ b/chrome/browser/sync/engine/syncer_unittest.cc @@ -200,7 +200,7 @@ class SyncerTest : public testing::Test, std::vector<SyncEngineEventListener*> listeners; listeners.push_back(this); context_.reset(new SyncSessionContext(mock_server_.get(), - syncdb_.manager(), this, listeners, NULL)); + syncdb_.manager(), this, listeners)); context_->set_account_name(syncdb_.name()); ASSERT_FALSE(context_->resolver()); syncer_ = new Syncer(); diff --git a/chrome/browser/sync/internal_api/debug_info_event_listener.cc b/chrome/browser/sync/internal_api/debug_info_event_listener.cc deleted file mode 100644 index 3165496..0000000 --- a/chrome/browser/sync/internal_api/debug_info_event_listener.cc +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) 2011 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 "chrome/browser/sync/internal_api/debug_info_event_listener.h" - -using browser_sync::sessions::SyncSessionSnapshot; -namespace sync_api { - -DebugInfoEventListener::DebugInfoEventListener() - : events_dropped_(false) { -} - -DebugInfoEventListener::~DebugInfoEventListener() { -} - -void DebugInfoEventListener::OnSyncCycleCompleted( - const SyncSessionSnapshot* snapshot) { - if (!snapshot) - return; - - sync_pb::DebugEventInfo event_info; - sync_pb::SyncCycleCompletedEventInfo* sync_completed_event_info = - event_info.mutable_sync_cycle_completed_event_info(); - - sync_completed_event_info->set_syncer_stuck( - snapshot->syncer_status.syncer_stuck); - sync_completed_event_info->set_num_blocking_conflicts( - snapshot->num_conflicting_updates); - sync_completed_event_info->set_num_non_blocking_conflicts( - snapshot->num_blocking_conflicting_updates); - - AddEventToQueue(event_info); -} - -void DebugInfoEventListener::OnInitializationComplete( - const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, - bool success) { - CreateAndAddEvent(sync_pb::DebugEventInfo::INITIALIZATION_COMPLETE); -} - -void DebugInfoEventListener::OnAuthError( - const GoogleServiceAuthError& auth_error) { - CreateAndAddEvent(sync_pb::DebugEventInfo::AUTH_ERROR); -} - -void DebugInfoEventListener::OnPassphraseRequired( - sync_api::PassphraseRequiredReason reason) { - CreateAndAddEvent(sync_pb::DebugEventInfo::PASSPHRASE_REQUIRED); -} - -void DebugInfoEventListener::OnPassphraseAccepted( - const std::string& bootstrap_token) { - CreateAndAddEvent(sync_pb::DebugEventInfo::PASSPHRASE_ACCEPTED); -} - -void DebugInfoEventListener::OnStopSyncingPermanently() { - CreateAndAddEvent(sync_pb::DebugEventInfo::STOP_SYNCING_PERMANENTLY); -} - -void DebugInfoEventListener::OnUpdatedToken(const std::string& token) { - CreateAndAddEvent(sync_pb::DebugEventInfo::UPDATED_TOKEN); -} - -void DebugInfoEventListener::OnClearServerDataFailed() { - // This command is not implemented on the client side. - NOTREACHED(); -} - -void DebugInfoEventListener::OnClearServerDataSucceeded() { - // This command is not implemented on the client side. - NOTREACHED(); -} - -void DebugInfoEventListener::OnEncryptionComplete( - const syncable::ModelTypeSet& encrypted_types) { - CreateAndAddEvent(sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE); -} - -void DebugInfoEventListener::OnActionableError( - const browser_sync::SyncProtocolError& sync_error) { - CreateAndAddEvent(sync_pb::DebugEventInfo::ACTIONABLE_ERROR); -} - -void DebugInfoEventListener::GetAndClearDebugInfo( - sync_pb::DebugInfo* debug_info) { - DCHECK(events_.size() <= sync_api::kMaxEntries); - while (!events_.empty()) { - sync_pb::DebugEventInfo* event_info = debug_info->add_events(); - const sync_pb::DebugEventInfo& debug_event_info = events_.front(); - event_info->CopyFrom(debug_event_info); - events_.pop(); - } - - debug_info->set_events_dropped(events_dropped_); - - events_dropped_ = false; -} - -void DebugInfoEventListener::CreateAndAddEvent( - sync_pb::DebugEventInfo::EventType type) { - sync_pb::DebugEventInfo event_info; - event_info.set_type(type); - AddEventToQueue(event_info); -} - -void DebugInfoEventListener::AddEventToQueue( - const sync_pb::DebugEventInfo& event_info) { - if (events_.size() >= sync_api::kMaxEntries) { - VLOG(1) << "DebugInfoEventListener::AddEventToQueue Dropping an old event " - << "because of full queue"; - - events_.pop(); - events_dropped_ = true; - } - events_.push(event_info); -} -} // namespace sync_api diff --git a/chrome/browser/sync/internal_api/debug_info_event_listener.h b/chrome/browser/sync/internal_api/debug_info_event_listener.h deleted file mode 100644 index 6a1a2f1..0000000 --- a/chrome/browser/sync/internal_api/debug_info_event_listener.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2011 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_INTERNAL_API_DEBUG_INFO_EVENT_LISTENER_H_ -#define CHROME_BROWSER_SYNC_INTERNAL_API_DEBUG_INFO_EVENT_LISTENER_H_ - -#include <string> - -#include "chrome/browser/sync/internal_api/sync_manager.h" -#include "chrome/browser/sync/js/js_backend.h" -#include "chrome/browser/sync/protocol/sync.pb.h" -#include "chrome/browser/sync/sessions/debug_info_getter.h" -#include "chrome/browser/sync/sessions/session_state.h" -#include "chrome/browser/sync/util/weak_handle.h" -#include "chrome/common/net/gaia/google_service_auth_error.h" - -namespace sync_api { - -const unsigned int kMaxEntries = 6; - -// Listens to events and records them in a queue. And passes the events to -// syncer when requested. -class DebugInfoEventListener : public sync_api::SyncManager::Observer, - public browser_sync::sessions::DebugInfoGetter { - public: - DebugInfoEventListener(); - virtual ~DebugInfoEventListener(); - - // SyncManager::Observer implementation. - virtual void OnSyncCycleCompleted( - const browser_sync::sessions::SyncSessionSnapshot* snapshot) OVERRIDE; - virtual void OnInitializationComplete( - const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, - bool success) OVERRIDE; - virtual void OnAuthError( - const GoogleServiceAuthError& auth_error) OVERRIDE; - virtual void OnPassphraseRequired( - sync_api::PassphraseRequiredReason reason) OVERRIDE; - virtual void OnPassphraseAccepted( - const std::string& bootstrap_token) OVERRIDE; - virtual void OnStopSyncingPermanently() OVERRIDE; - virtual void OnUpdatedToken(const std::string& token) OVERRIDE; - virtual void OnClearServerDataFailed() OVERRIDE; - virtual void OnClearServerDataSucceeded() OVERRIDE; - virtual void OnEncryptionComplete( - const syncable::ModelTypeSet& encrypted_types) OVERRIDE; - virtual void OnActionableError( - const browser_sync::SyncProtocolError& sync_error) OVERRIDE; - - // DebugInfoGetter Implementation. - virtual void GetAndClearDebugInfo(sync_pb::DebugInfo* debug_info) OVERRIDE; - - private: - FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyEventsAdded); - FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyQueueSize); - FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyGetAndClearEvents); - - void AddEventToQueue(const sync_pb::DebugEventInfo& event_info); - void CreateAndAddEvent(sync_pb::DebugEventInfo::EventType type); - std::queue<sync_pb::DebugEventInfo> events_; - - // True indicates we had to drop one or more events to keep our limit of - // |kMaxEntries|. - bool events_dropped_; - - DISALLOW_COPY_AND_ASSIGN(DebugInfoEventListener); -}; - -} // namespace sync_api -#endif // CHROME_BROWSER_SYNC_INTERNAL_API_DEBUG_INFO_EVENT_LISTENER_H_ diff --git a/chrome/browser/sync/internal_api/debug_info_event_listener_unittest.cc b/chrome/browser/sync/internal_api/debug_info_event_listener_unittest.cc deleted file mode 100644 index 79b99ba..0000000 --- a/chrome/browser/sync/internal_api/debug_info_event_listener_unittest.cc +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2011 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 "chrome/browser/sync/internal_api/debug_info_event_listener.h" -#include "testing/gtest/include/gtest/gtest.h" - -typedef testing::Test DebugInfoEventListenerTest; - -namespace sync_api { -TEST_F(DebugInfoEventListenerTest, VerifyEventsAdded) { - sync_api::DebugInfoEventListener debug_info_event_listener; - debug_info_event_listener.CreateAndAddEvent( - sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE); - ASSERT_EQ(debug_info_event_listener.events_.size(), 1U); - const sync_pb::DebugEventInfo& debug_info = - debug_info_event_listener.events_.back(); - ASSERT_TRUE(debug_info.has_type()); - ASSERT_EQ(debug_info.type(), sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE); -} - -TEST_F(DebugInfoEventListenerTest, VerifyQueueSize) { - sync_api::DebugInfoEventListener debug_info_event_listener; - for (int i = 0; i < 10; ++i) { - debug_info_event_listener.CreateAndAddEvent( - sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE); - } - ASSERT_EQ(debug_info_event_listener.events_.size(), - sync_api::kMaxEntries); -} - -TEST_F(DebugInfoEventListenerTest, VerifyGetAndClearEvents) { - sync_api::DebugInfoEventListener debug_info_event_listener; - debug_info_event_listener.CreateAndAddEvent( - sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE); - ASSERT_EQ(debug_info_event_listener.events_.size(), 1U); - sync_pb::DebugInfo debug_info; - debug_info_event_listener.GetAndClearDebugInfo(&debug_info); - ASSERT_EQ(debug_info_event_listener.events_.size(), 0U); - ASSERT_EQ(debug_info.events_size(), 1); - ASSERT_TRUE(debug_info.events(0).has_type()); - ASSERT_EQ(debug_info.events(0).type(), - sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE); -} - -} // namespace sync_api diff --git a/chrome/browser/sync/internal_api/sync_manager.cc b/chrome/browser/sync/internal_api/sync_manager.cc index c8435b6..0bef79a 100644 --- a/chrome/browser/sync/internal_api/sync_manager.cc +++ b/chrome/browser/sync/internal_api/sync_manager.cc @@ -24,7 +24,6 @@ #include "chrome/browser/sync/internal_api/base_node.h" #include "chrome/browser/sync/internal_api/change_reorder_buffer.h" #include "chrome/browser/sync/internal_api/configure_reason.h" -#include "chrome/browser/sync/internal_api/debug_info_event_listener.h" #include "chrome/browser/sync/internal_api/read_node.h" #include "chrome/browser/sync/internal_api/read_transaction.h" #include "chrome/browser/sync/internal_api/syncapi_server_connection_manager.h" @@ -552,9 +551,6 @@ class SyncManager::SyncInternal JsSyncManagerObserver js_sync_manager_observer_; JsMutationEventObserver js_mutation_event_observer_; - // This is for keeping track of client events to send to the server. - DebugInfoEventListener debug_info_event_listener_; - MessageLoop* const created_on_loop_; }; const int SyncManager::SyncInternal::kDefaultNudgeDelayMilliseconds = 200; @@ -770,8 +766,6 @@ bool SyncManager::SyncInternal::Init( AddObserver(&js_sync_manager_observer_); SetJsEventHandler(event_handler); - AddObserver(&debug_info_event_listener_); - share_.dir_manager.reset(new DirectoryManager(database_location)); connection_manager_.reset(new SyncAPIServerConnectionManager( @@ -793,8 +787,7 @@ bool SyncManager::SyncInternal::Init( connection_manager_.get(), dir_manager(), model_safe_worker_registrar, - listeners, - &debug_info_event_listener_); + listeners); context->set_account_name(credentials.email); // The SyncScheduler takes ownership of |context|. scheduler_.reset(new SyncScheduler(name_, context, new Syncer())); @@ -1278,8 +1271,6 @@ void SyncManager::SyncInternal::ShutdownOnSyncThread() { SetJsEventHandler(WeakHandle<JsEventHandler>()); RemoveObserver(&js_sync_manager_observer_); - RemoveObserver(&debug_info_event_listener_); - if (sync_notifier_.get()) { sync_notifier_->RemoveObserver(this); } diff --git a/chrome/browser/sync/protocol/client_debug_info.proto b/chrome/browser/sync/protocol/client_debug_info.proto deleted file mode 100644 index b443e36..0000000 --- a/chrome/browser/sync/protocol/client_debug_info.proto +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2011 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. -// -// Common sync protocol for encrypted data. - -// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change -// any fields in this file. - -syntax = "proto2"; - -option optimize_for = LITE_RUNTIME; -option retain_unknown_fields = true; - -package sync_pb; - -// The additional info here is from SyncerStatus. They get sent when the event -// SYNC_CYCLE_COMPLETED is sent. -message SyncCycleCompletedEventInfo { - optional bool syncer_stuck = 1; - optional int32 num_blocking_conflicts = 2; - optional int32 num_non_blocking_conflicts = 3; -} - -message DebugEventInfo { - // These events are sent by |SyncManager| class. Note: In the code they each - // of these events have some additional info but we are not sending them to - // server. - enum EventType { - AUTH_ERROR = 1; // Auth error. Note this gets generated even during - // successful auth with the error set to none. - UPDATED_TOKEN = 2; // Client received an updated token. - PASSPHRASE_REQUIRED = 3; // Cryptographer needs passphrase. - PASSPHRASE_ACCEPTED = 4; // Passphrase was accepted by cryptographer. - INITIALIZATION_COMPLETE = 5; // Sync Initialization is complete. - - // |STOP_SYNCING_PERMANENTLY| event should never be seen by the server in - // the absence of bugs. - STOP_SYNCING_PERMANENTLY = 6; // Server sent stop syncing permanently. - - ENCRYPTION_COMPLETE = 7; // Client has finished encrypting all data. - ACTIONABLE_ERROR = 8; // Client received an actionable error. - } - optional EventType type = 1; - optional SyncCycleCompletedEventInfo sync_cycle_completed_event_info = 2; -} - -message DebugInfo { - repeated DebugEventInfo events = 1; - - // Whether cryptographer is ready to encrypt and decrypt data. - optional bool cryptographer_ready = 2; - - // Cryptographer has pending keys which indicates the correct passphrase - // has not been provided yet. - optional bool cryptographer_has_pending_keys = 3; - - // Indicates client has dropped some events to save bandwidth. - optional bool events_dropped = 4; -}
\ No newline at end of file diff --git a/chrome/browser/sync/protocol/sync.proto b/chrome/browser/sync/protocol/sync.proto index b4e1826..cb4be4f 100644 --- a/chrome/browser/sync/protocol/sync.proto +++ b/chrome/browser/sync/protocol/sync.proto @@ -15,7 +15,6 @@ option retain_unknown_fields = true; package sync_pb; import "encryption.proto"; -import "client_debug_info.proto"; // Used for inspecting how long we spent performing operations in different // backends. All times must be in millis. @@ -439,11 +438,6 @@ message ClientToServerMessage { // The client sets this if it detects a sync issue. The server will tell it // if it should perform a refresh. optional bool sync_problem_detected = 8 [default = false]; - - // Client side state information for debugging purpose. - // This is only sent on the first getupdates of every sync cycle, - // as an optimization to save bandwidth. - optional DebugInfo debug_info = 10; }; message CommitResponse { diff --git a/chrome/browser/sync/protocol/sync_proto.gyp b/chrome/browser/sync/protocol/sync_proto.gyp index 9f5bde1..3af79f4 100644 --- a/chrome/browser/sync/protocol/sync_proto.gyp +++ b/chrome/browser/sync/protocol/sync_proto.gyp @@ -17,7 +17,6 @@ 'app_specifics.proto', 'autofill_specifics.proto', 'bookmark_specifics.proto', - 'client_debug_info.proto', 'extension_setting_specifics.proto', 'extension_specifics.proto', 'nigori_specifics.proto', diff --git a/chrome/browser/sync/sessions/session_state.h b/chrome/browser/sync/sessions/session_state.h index 87f71ac..c6ee65b 100644 --- a/chrome/browser/sync/sessions/session_state.h +++ b/chrome/browser/sync/sessions/session_state.h @@ -271,8 +271,7 @@ class UpdateProgress { struct SyncCycleControlParameters { SyncCycleControlParameters() : conflict_sets_built(false), conflicts_resolved(false), - items_committed(false), - debug_info_sent(false) {} + items_committed(false) {} // Set to true by BuildAndProcessConflictSetsCommand if the RESOLVE_CONFLICTS // step is needed. bool conflict_sets_built; @@ -282,9 +281,6 @@ struct SyncCycleControlParameters { // Set to true by PostCommitMessageCommand if any commits were successful. bool items_committed; - - // True indicates debug info has been sent once this session. - bool debug_info_sent; }; // DirtyOnWrite wraps a value such that any write operation will update a diff --git a/chrome/browser/sync/sessions/status_controller.cc b/chrome/browser/sync/sessions/status_controller.cc index edfebe6..24a588d 100644 --- a/chrome/browser/sync/sessions/status_controller.cc +++ b/chrome/browser/sync/sessions/status_controller.cc @@ -242,13 +242,5 @@ bool StatusController::ServerSaysNothingMoreToDownload() const { return updates_response().get_updates().changes_remaining() == 0; } -void StatusController::set_debug_info_sent() { - shared_.control_params.debug_info_sent = true; -} - -bool StatusController::debug_info_sent() { - return shared_.control_params.debug_info_sent; -} - } // namespace sessions } // namespace browser_sync diff --git a/chrome/browser/sync/sessions/status_controller.h b/chrome/browser/sync/sessions/status_controller.h index ec1437d..a12bee8 100644 --- a/chrome/browser/sync/sessions/status_controller.h +++ b/chrome/browser/sync/sessions/status_controller.h @@ -239,10 +239,6 @@ class StatusController { void SetSyncInProgressAndUpdateStartTime(bool sync_in_progress); - void set_debug_info_sent(); - - bool debug_info_sent(); - private: friend class ScopedModelSafeGroupRestriction; diff --git a/chrome/browser/sync/sessions/sync_session_context.cc b/chrome/browser/sync/sessions/sync_session_context.cc index f06c300..f0cbce4 100644 --- a/chrome/browser/sync/sessions/sync_session_context.cc +++ b/chrome/browser/sync/sessions/sync_session_context.cc @@ -5,7 +5,6 @@ #include "chrome/browser/sync/sessions/sync_session_context.h" #include "chrome/browser/sync/util/extensions_activity_monitor.h" -#include "chrome/browser/sync/sessions/debug_info_getter.h" #include "chrome/browser/sync/sessions/session_state.h" #include "content/browser/browser_thread.h" @@ -16,16 +15,14 @@ SyncSessionContext::SyncSessionContext( ServerConnectionManager* connection_manager, syncable::DirectoryManager* directory_manager, ModelSafeWorkerRegistrar* model_safe_worker_registrar, - const std::vector<SyncEngineEventListener*>& listeners, - DebugInfoGetter* debug_info_getter) + const std::vector<SyncEngineEventListener*>& listeners) : resolver_(NULL), connection_manager_(connection_manager), directory_manager_(directory_manager), registrar_(model_safe_worker_registrar), extensions_activity_monitor_(new ExtensionsActivityMonitor()), notifications_enabled_(false), - max_commit_batch_size_(kDefaultMaxCommitBatchSize), - debug_info_getter_(debug_info_getter) { + max_commit_batch_size_(kDefaultMaxCommitBatchSize) { std::vector<SyncEngineEventListener*>::const_iterator it; for (it = listeners.begin(); it != listeners.end(); ++it) listeners_.AddObserver(*it); diff --git a/chrome/browser/sync/sessions/sync_session_context.h b/chrome/browser/sync/sessions/sync_session_context.h index fbd5c0d..a3a69ec 100644 --- a/chrome/browser/sync/sessions/sync_session_context.h +++ b/chrome/browser/sync/sessions/sync_session_context.h @@ -24,7 +24,6 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync/engine/model_safe_worker.h" #include "chrome/browser/sync/engine/syncer_types.h" -#include "chrome/browser/sync/sessions/debug_info_getter.h" namespace syncable { class DirectoryManager; @@ -50,8 +49,7 @@ class SyncSessionContext { SyncSessionContext(ServerConnectionManager* connection_manager, syncable::DirectoryManager* directory_manager, ModelSafeWorkerRegistrar* model_safe_worker_registrar, - const std::vector<SyncEngineEventListener*>& listeners, - DebugInfoGetter* debug_info_getter); + const std::vector<SyncEngineEventListener*>& listeners); ~SyncSessionContext(); ConflictResolver* resolver() { return resolver_; } @@ -68,10 +66,6 @@ class SyncSessionContext { return extensions_activity_monitor_; } - DebugInfoGetter* debug_info_getter() { - return debug_info_getter_; - } - // Talk notification status. void set_notifications_enabled(bool enabled) { notifications_enabled_ = enabled; @@ -143,10 +137,6 @@ class SyncSessionContext { // Cache of last session snapshot information. scoped_ptr<sessions::SyncSessionSnapshot> previous_session_snapshot_; - // We use this to get debug info to send to the server for debugging - // client behavior on server side. - DebugInfoGetter* const debug_info_getter_; - DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); }; diff --git a/chrome/browser/sync/sessions/sync_session_unittest.cc b/chrome/browser/sync/sessions/sync_session_unittest.cc index 8c46802..7d7a715 100644 --- a/chrome/browser/sync/sessions/sync_session_unittest.cc +++ b/chrome/browser/sync/sessions/sync_session_unittest.cc @@ -37,7 +37,7 @@ class SyncSessionTest : public testing::Test, virtual void SetUp() { context_.reset(new SyncSessionContext(NULL, NULL, this, - std::vector<SyncEngineEventListener*>(), NULL)); + std::vector<SyncEngineEventListener*>())); routes_.clear(); routes_[syncable::BOOKMARKS] = GROUP_UI; routes_[syncable::AUTOFILL] = GROUP_UI; @@ -122,7 +122,7 @@ TEST_F(SyncSessionTest, SetWriteTransaction) { db.SetUp(); session_.reset(); context_.reset(new SyncSessionContext(NULL, db.manager(), this, - std::vector<SyncEngineEventListener*>(), NULL)); + std::vector<SyncEngineEventListener*>())); session_.reset(MakeSession()); context_->set_account_name(db.name()); syncable::ScopedDirLookup dir(context_->directory_manager(), diff --git a/chrome/browser/sync/test/engine/syncer_command_test.cc b/chrome/browser/sync/test/engine/syncer_command_test.cc deleted file mode 100644 index 91a0207..0000000 --- a/chrome/browser/sync/test/engine/syncer_command_test.cc +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2011 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 "chrome/browser/sync/test/engine/syncer_command_test.h" - -namespace browser_sync { -MockDebugInfoGetter::MockDebugInfoGetter() { -} - -MockDebugInfoGetter::~MockDebugInfoGetter() { -} - -} // namespace browser_sync diff --git a/chrome/browser/sync/test/engine/syncer_command_test.h b/chrome/browser/sync/test/engine/syncer_command_test.h index 55460b7..ae9be64 100644 --- a/chrome/browser/sync/test/engine/syncer_command_test.h +++ b/chrome/browser/sync/test/engine/syncer_command_test.h @@ -12,25 +12,14 @@ #include "base/compiler_specific.h" #include "chrome/browser/sync/engine/model_safe_worker.h" -#include "chrome/browser/sync/sessions/debug_info_getter.h" #include "chrome/browser/sync/sessions/sync_session.h" #include "chrome/browser/sync/sessions/sync_session_context.h" #include "chrome/browser/sync/test/engine/mock_connection_manager.h" #include "chrome/browser/sync/test/engine/test_directory_setter_upper.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gmock/include/gmock/gmock.h" - -using ::testing::NiceMock; namespace browser_sync { -class MockDebugInfoGetter : public browser_sync::sessions::DebugInfoGetter { - public: - MockDebugInfoGetter(); - virtual ~MockDebugInfoGetter(); - MOCK_METHOD1(GetAndClearDebugInfo, void(sync_pb::DebugInfo* debug_info)); -}; - // A test fixture that simplifies writing unit tests for individual // SyncerCommands, providing convenient access to a test directory // and a syncer session. @@ -128,7 +117,7 @@ class SyncerCommandTestWithParam : public testing::TestWithParam<T>, void ResetContext() { context_.reset(new sessions::SyncSessionContext( mock_server_.get(), syncdb_->manager(), registrar(), - std::vector<SyncEngineEventListener*>(), &mock_debug_info_getter_)); + std::vector<SyncEngineEventListener*>())); context_->set_account_name(syncdb_->name()); ClearSession(); } @@ -152,10 +141,6 @@ class SyncerCommandTestWithParam : public testing::TestWithParam<T>, return mock_server_.get(); } - MockDebugInfoGetter* mock_debug_info_getter() { - return &mock_debug_info_getter_; - } - private: scoped_ptr<TestDirectorySetterUpper> syncdb_; scoped_ptr<sessions::SyncSessionContext> context_; @@ -163,7 +148,6 @@ class SyncerCommandTestWithParam : public testing::TestWithParam<T>, scoped_ptr<sessions::SyncSession> session_; std::vector<scoped_refptr<ModelSafeWorker> > workers_; ModelSafeRoutingInfo routing_info_; - NiceMock<MockDebugInfoGetter> mock_debug_info_getter_; DISALLOW_COPY_AND_ASSIGN(SyncerCommandTestWithParam); }; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 1901409..e9a90e2 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -493,8 +493,6 @@ 'browser/sync/internal_api/change_reorder_buffer.cc', 'browser/sync/internal_api/change_reorder_buffer.h', 'browser/sync/internal_api/configure_reason.h', - 'browser/sync/internal_api/debug_info_event_listener.cc', - 'browser/sync/internal_api/debug_info_event_listener.h', 'browser/sync/internal_api/http_post_provider_factory.h', 'browser/sync/internal_api/http_post_provider_interface.h', 'browser/sync/internal_api/read_node.cc', @@ -659,7 +657,6 @@ 'browser/sync/protocol/service_constants.h', 'browser/sync/protocol/sync_protocol_error.cc', 'browser/sync/protocol/sync_protocol_error.h', - 'browser/sync/sessions/debug_info_getter.h', 'browser/sync/sessions/ordered_commit_set.cc', 'browser/sync/sessions/ordered_commit_set.h', 'browser/sync/sessions/session_state.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 8cd0133..e15d36d 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -3031,7 +3031,6 @@ 'browser/sync/engine/syncproto_unittest.cc', 'browser/sync/engine/verify_updates_command_unittest.cc', 'browser/sync/internal_api/change_record_unittest.cc', - 'browser/sync/internal_api/debug_info_event_listener_unittest.cc', 'browser/sync/internal_api/syncapi_mock.h', 'browser/sync/internal_api/syncapi_server_connection_manager_unittest.cc', 'browser/sync/internal_api/syncapi_unittest.cc', @@ -3067,7 +3066,6 @@ 'browser/sync/test/engine/mock_gaia_authenticator.cc', 'browser/sync/test/engine/mock_gaia_authenticator.h', 'browser/sync/test/engine/mock_gaia_authenticator_unittest.cc', - 'browser/sync/test/engine/syncer_command_test.cc', 'browser/sync/test/engine/syncer_command_test.h', 'browser/sync/test/engine/test_id_factory.h', 'browser/sync/test/engine/test_syncable_utils.cc', |