Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2238)

Unified Diff: chrome/browser/sync/internal_api/sync_manager.cc

Issue 8189003: Send important client side event information to the server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/internal_api/sync_manager.cc
diff --git a/chrome/browser/sync/internal_api/sync_manager.cc b/chrome/browser/sync/internal_api/sync_manager.cc
index 0bef79a7fe66918269d856bd61b6410a9dc75e1d..6bd2e2fb44b204a546595e3a135e94e285572799 100644
--- a/chrome/browser/sync/internal_api/sync_manager.cc
+++ b/chrome/browser/sync/internal_api/sync_manager.cc
@@ -24,6 +24,7 @@
#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"
@@ -136,7 +137,8 @@ class SyncManager::SyncInternal
initialized_(false),
setup_for_test_mode_(false),
observing_ip_address_changes_(false),
- created_on_loop_(MessageLoop::current()) {
+ created_on_loop_(MessageLoop::current()),
+ debug_info_event_listener_() {
// Pre-fill |notification_info_map_|.
for (int i = syncable::FIRST_REAL_MODEL_TYPE;
i < syncable::MODEL_TYPE_COUNT; ++i) {
@@ -551,6 +553,9 @@ 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;
@@ -766,6 +771,8 @@ 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(
@@ -787,7 +794,8 @@ bool SyncManager::SyncInternal::Init(
connection_manager_.get(),
dir_manager(),
model_safe_worker_registrar,
- listeners);
+ listeners,
+ &debug_info_event_listener_);
context->set_account_name(credentials.email);
// The SyncScheduler takes ownership of |context|.
scheduler_.reset(new SyncScheduler(name_, context, new Syncer()));
@@ -1271,6 +1279,8 @@ 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);
}

Powered by Google App Engine
This is Rietveld 408576698