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

Unified Diff: sync/internal_api/sync_manager.cc

Issue 10454105: sync: Refactor per-datatype throttling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 6 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
« no previous file with comments | « sync/internal_api/sync_manager.h ('k') | sync/sessions/sync_session_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_manager.cc
diff --git a/sync/internal_api/sync_manager.cc b/sync/internal_api/sync_manager.cc
index 1e8b7dd5b985d6a3a8969456d5ef5194b0599993..0564af5d8e945d1f9fd2b4ebe147592c83890ba3 100644
--- a/sync/internal_api/sync_manager.cc
+++ b/sync/internal_api/sync_manager.cc
@@ -18,11 +18,12 @@
#include "base/string_number_conversions.h"
#include "base/values.h"
#include "net/base/network_change_notifier.h"
+#include "sync/engine/all_status.h"
#include "sync/engine/net/server_connection_manager.h"
#include "sync/engine/nigori_util.h"
#include "sync/engine/sync_scheduler.h"
#include "sync/engine/syncer_types.h"
-#include "sync/internal_api/all_status.h"
+#include "sync/engine/throttled_data_type_tracker.h"
#include "sync/internal_api/base_node.h"
#include "sync/internal_api/change_reorder_buffer.h"
#include "sync/internal_api/configure_reason.h"
@@ -144,6 +145,7 @@ class SyncManager::SyncInternal
initialized_(false),
testing_mode_(NON_TEST),
observing_ip_address_changes_(false),
+ throttled_data_type_tracker_(&allstatus_),
traffic_recorder_(kMaxMessagesToRecord, kMaxMessageSizeToRecord),
encryptor_(NULL),
unrecoverable_error_handler_(NULL),
@@ -346,7 +348,7 @@ class SyncManager::SyncInternal
return share_.name;
}
- Status GetStatus();
+ SyncStatus GetStatus();
void RequestNudge(const tracked_objects::Location& nudge_location);
@@ -602,6 +604,8 @@ class SyncManager::SyncInternal
JsSyncManagerObserver js_sync_manager_observer_;
JsMutationEventObserver js_mutation_event_observer_;
+ browser_sync::ThrottledDataTypeTracker throttled_data_type_tracker_;
+
// This is for keeping track of client events to send to the server.
DebugInfoEventListener debug_info_event_listener_;
@@ -702,36 +706,6 @@ SyncManager::Observer::~Observer() {}
SyncManager::SyncManager(const std::string& name)
: data_(new SyncInternal(name)) {}
-SyncManager::Status::Status()
- : notifications_enabled(false),
- notifications_received(0),
- encryption_conflicts(0),
- hierarchy_conflicts(0),
- simple_conflicts(0),
- server_conflicts(0),
- committed_count(0),
- syncing(false),
- initial_sync_ended(false),
- updates_available(0),
- updates_received(0),
- reflected_updates_received(0),
- tombstone_updates_received(0),
- num_commits_total(0),
- num_local_overwrites_total(0),
- num_server_overwrites_total(0),
- nonempty_get_updates(0),
- empty_get_updates(0),
- sync_cycles_with_commits(0),
- sync_cycles_without_commits(0),
- useless_sync_cycles(0),
- useful_sync_cycles(0),
- cryptographer_ready(false),
- crypto_has_pending_keys(false) {
-}
-
-SyncManager::Status::~Status() {
-}
-
bool SyncManager::Init(
const FilePath& database_location,
const WeakHandle<JsEventHandler>& event_handler,
@@ -955,6 +929,7 @@ bool SyncManager::SyncInternal::Init(
model_safe_routing_info,
workers,
extensions_activity_monitor,
+ &throttled_data_type_tracker_,
listeners,
&debug_info_event_listener_,
&traffic_recorder_));
@@ -1959,7 +1934,7 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncer(
}
}
-SyncManager::Status SyncManager::SyncInternal::GetStatus() {
+SyncStatus SyncManager::SyncInternal::GetStatus() {
return allstatus_.status();
}
@@ -2378,7 +2353,7 @@ void SyncManager::SyncInternal::RemoveObserver(
observers_.RemoveObserver(observer);
}
-SyncManager::Status SyncManager::GetDetailedStatus() const {
+SyncStatus SyncManager::GetDetailedStatus() const {
return data_->GetStatus();
}
« no previous file with comments | « sync/internal_api/sync_manager.h ('k') | sync/sessions/sync_session_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698