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

Unified Diff: sync/sessions/sync_session.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/sessions/session_state_unittest.cc ('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/sessions/sync_session.cc
diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc
index 0d5835e19a371f474c27b2acbd8eda7f739a87d8..4c58215d6952b6939f1b247f3128ff00ce5b95ab 100644
--- a/sync/sessions/sync_session.cc
+++ b/sync/sessions/sync_session.cc
@@ -137,7 +137,7 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
bool is_share_useable = true;
syncable::ModelTypeSet initial_sync_ended;
- std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
+ syncable::ModelTypePayloadMap download_progress_markers;
for (int i = syncable::FIRST_REAL_MODEL_TYPE;
i < syncable::MODEL_TYPE_COUNT; ++i) {
syncable::ModelType type(syncable::ModelTypeFromInt(i));
@@ -147,7 +147,7 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
else
is_share_useable = false;
}
- dir->GetDownloadProgressAsString(type, &download_progress_markers[i]);
+ dir->GetDownloadProgressAsString(type, &download_progress_markers[type]);
}
return SyncSessionSnapshot(
@@ -174,10 +174,9 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
void SyncSession::SendEventNotification(SyncEngineEvent::EventCause cause) {
SyncEngineEvent event(cause);
- const SyncSessionSnapshot& snapshot = TakeSnapshot();
- event.snapshot = &snapshot;
+ event.snapshot = TakeSnapshot();
- DVLOG(1) << "Sending event with snapshot: " << snapshot.ToString();
+ DVLOG(1) << "Sending event with snapshot: " << event.snapshot.ToString();
context()->NotifyListeners(event);
}
« no previous file with comments | « sync/sessions/session_state_unittest.cc ('k') | sync/sessions/sync_session_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698