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

Unified Diff: components/sync/sessions_impl/nudge_tracker.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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: components/sync/sessions_impl/nudge_tracker.cc
diff --git a/sync/sessions/nudge_tracker.cc b/components/sync/sessions_impl/nudge_tracker.cc
similarity index 90%
rename from sync/sessions/nudge_tracker.cc
rename to components/sync/sessions_impl/nudge_tracker.cc
index 0a611b28a95a1919858cc853842ec01482d8a62d..e2cf767281516e5945e9bf064282c2a8b07511a6 100644
--- a/sync/sessions/nudge_tracker.cc
+++ b/components/sync/sessions_impl/nudge_tracker.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/sessions/nudge_tracker.h"
+#include "components/sync/sessions_impl/nudge_tracker.h"
#include <stddef.h>
#include <utility>
#include "base/memory/ptr_util.h"
-#include "sync/internal_api/public/engine/polling_constants.h"
-#include "sync/protocol/sync.pb.h"
+#include "components/sync/engine/polling_constants.h"
+#include "components/sync/protocol/sync.pb.h"
namespace syncer {
namespace sessions {
@@ -28,22 +28,22 @@ base::TimeDelta GetDefaultDelayForType(ModelType model_type,
base::TimeDelta minimum_delay) {
switch (model_type) {
case AUTOFILL:
- // Accompany types rely on nudges from other types, and hence have long
- // nudge delays.
- return base::TimeDelta::FromSeconds(kDefaultShortPollIntervalSeconds);
+ // Accompany types rely on nudges from other types, and hence have long
+ // nudge delays.
+ return base::TimeDelta::FromSeconds(kDefaultShortPollIntervalSeconds);
case BOOKMARKS:
case PREFERENCES:
- // Types with sometimes automatic changes get longer delays to allow more
- // coalescing.
- return base::TimeDelta::FromMilliseconds(kSlowNudgeDelayMilliseconds);
+ // Types with sometimes automatic changes get longer delays to allow more
+ // coalescing.
+ return base::TimeDelta::FromMilliseconds(kSlowNudgeDelayMilliseconds);
case SESSIONS:
case FAVICON_IMAGES:
case FAVICON_TRACKING:
- // Types with navigation triggered changes get longer delays to allow more
- // coalescing.
- return base::TimeDelta::FromSeconds(kDefaultSessionsCommitDelaySeconds);
+ // Types with navigation triggered changes get longer delays to allow more
+ // coalescing.
+ return base::TimeDelta::FromSeconds(kDefaultSessionsCommitDelaySeconds);
default:
- return minimum_delay;
+ return minimum_delay;
}
}
@@ -69,7 +69,7 @@ NudgeTracker::NudgeTracker()
}
}
-NudgeTracker::~NudgeTracker() { }
+NudgeTracker::~NudgeTracker() {}
bool NudgeTracker::IsSyncRequired() const {
if (IsRetryRequired())
@@ -139,8 +139,8 @@ base::TimeDelta NudgeTracker::RecordLocalChange(ModelTypeSet types) {
// than the calculated delay do we update the calculated delay.
base::TimeDelta type_delay = tracker_it->second->RecordLocalChange();
if (type_delay.is_zero()) {
- type_delay = GetDefaultDelayForType(type_it.Get(),
- minimum_local_nudge_delay_);
+ type_delay =
+ GetDefaultDelayForType(type_it.Get(), minimum_local_nudge_delay_);
}
if (type_delay < delay)
delay = type_delay;
@@ -188,10 +188,9 @@ void NudgeTracker::OnInvalidationsDisabled() {
invalidations_out_of_sync_ = true;
}
-void NudgeTracker::SetTypesThrottledUntil(
- ModelTypeSet types,
- base::TimeDelta length,
- base::TimeTicks now) {
+void NudgeTracker::SetTypesThrottledUntil(ModelTypeSet types,
+ base::TimeDelta length,
+ base::TimeTicks now) {
for (ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) {
TypeTrackerMap::const_iterator tracker_it = type_trackers_.find(it.Get());
tracker_it->second->ThrottleType(length, now);
@@ -338,9 +337,8 @@ sync_pb::GetUpdatesCallerInfo::GetUpdatesSource NudgeTracker::GetLegacySource()
}
}
-void NudgeTracker::FillProtoMessage(
- ModelType type,
- sync_pb::GetUpdateTriggers* msg) const {
+void NudgeTracker::FillProtoMessage(ModelType type,
+ sync_pb::GetUpdateTriggers* msg) const {
DCHECK(type_trackers_.find(type) != type_trackers_.end());
// Fill what we can from the global data.
@@ -388,8 +386,7 @@ void NudgeTracker::OnReceivedCustomNudgeDelays(
const std::map<ModelType, base::TimeDelta>& delay_map) {
for (std::map<ModelType, base::TimeDelta>::const_iterator iter =
delay_map.begin();
- iter != delay_map.end();
- ++iter) {
+ iter != delay_map.end(); ++iter) {
ModelType type = iter->first;
DCHECK(syncer::ProtocolTypes().Has(type));
TypeTrackerMap::const_iterator type_iter = type_trackers_.find(type);
@@ -400,8 +397,7 @@ void NudgeTracker::OnReceivedCustomNudgeDelays(
type_iter->second->UpdateLocalNudgeDelay(iter->second);
} else {
type_iter->second->UpdateLocalNudgeDelay(
- GetDefaultDelayForType(type,
- minimum_local_nudge_delay_));
+ GetDefaultDelayForType(type, minimum_local_nudge_delay_));
}
}
}
« no previous file with comments | « components/sync/sessions_impl/nudge_tracker.h ('k') | components/sync/sessions_impl/nudge_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698