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

Unified Diff: sync/engine/sync_scheduler.cc

Issue 10197004: [Sync] Convert SyncSessionSnapshot to a copy-able class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 8 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/engine/sync_engine_event.cc ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_scheduler.cc
diff --git a/sync/engine/sync_scheduler.cc b/sync/engine/sync_scheduler.cc
index 87304ea576484fce9d96ad6bea8c64cd4fdc4f71..8baee7c75b021784536ddcb47d44a1c38a27ef13 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);
}
« no previous file with comments | « sync/engine/sync_engine_event.cc ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698