summaryrefslogtreecommitdiffstats
path: root/sync/engine/sync_scheduler.cc
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-24 19:32:28 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-24 19:32:28 +0000
commit90ce61b5448c93e52a34b71535d86605a4f7f90d (patch)
tree357c076b80e6bf248511878c8cde5b262466158f /sync/engine/sync_scheduler.cc
parent7500c55e2fc2219e50e3b6b40e6c8e3ed3820d20 (diff)
downloadchromium_src-90ce61b5448c93e52a34b71535d86605a4f7f90d.zip
chromium_src-90ce61b5448c93e52a34b71535d86605a4f7f90d.tar.gz
chromium_src-90ce61b5448c93e52a34b71535d86605a4f7f90d.tar.bz2
[Sync] Convert SyncSessionSnapshot to a copy-able class.
Previously it was an immutable struct that was passed around by making dynamic allocations and passing pointers. We now just have a class with only getters and no setters, but support for default copy and assign. This cleans up some code and makes some future work easier to pass snapshots around. BUG=none TEST=sync_unit_tests Review URL: http://codereview.chromium.org/10197004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/engine/sync_scheduler.cc')
-rw-r--r--sync/engine/sync_scheduler.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/sync/engine/sync_scheduler.cc b/sync/engine/sync_scheduler.cc
index 87304ea..8baee7c 100644
--- a/sync/engine/sync_scheduler.cc
+++ b/sync/engine/sync_scheduler.cc
@@ -270,8 +270,7 @@ void SyncScheduler::SendInitialSnapshot() {
SyncSourceInfo(), ModelSafeRoutingInfo(),
std::vector<ModelSafeWorker*>()));
SyncEngineEvent event(SyncEngineEvent::STATUS_CHANGED);
- sessions::SyncSessionSnapshot snapshot(dummy->TakeSnapshot());
- event.snapshot = &snapshot;
+ event.snapshot = dummy->TakeSnapshot();
session_context_->NotifyListeners(event);
}
@@ -1168,19 +1167,18 @@ void SyncScheduler::OnActionableError(
DCHECK_EQ(MessageLoop::current(), sync_loop_);
SDVLOG(2) << "OnActionableError";
SyncEngineEvent event(SyncEngineEvent::ACTIONABLE_ERROR);
- sessions::SyncSessionSnapshot snapshot(snap);
- event.snapshot = &snapshot;
+ event.snapshot = snap;
session_context_->NotifyListeners(event);
}
void SyncScheduler::OnSyncProtocolError(
const sessions::SyncSessionSnapshot& snapshot) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
- if (ShouldRequestEarlyExit(snapshot.errors.sync_protocol_error)) {
+ if (ShouldRequestEarlyExit(snapshot.errors().sync_protocol_error)) {
SDVLOG(2) << "Sync Scheduler requesting early exit.";
syncer_->RequestEarlyExit(); // Thread-safe.
}
- if (IsActionableError(snapshot.errors.sync_protocol_error))
+ if (IsActionableError(snapshot.errors().sync_protocol_error))
OnActionableError(snapshot);
}