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

Side by Side Diff: chrome/browser/sync/profile_sync_service_android.cc

Issue 19381005: Add version field to syncer::Invalidation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/profile_sync_service_android.h" 5 #include "chrome/browser/sync/profile_sync_service_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 (version <= it->second)) { 112 (version <= it->second)) {
113 DVLOG(1) << "Dropping redundant invalidation with version " << version; 113 DVLOG(1) << "Dropping redundant invalidation with version " << version;
114 return; 114 return;
115 } 115 }
116 max_invalidation_versions_[object_id] = version; 116 max_invalidation_versions_[object_id] = version;
117 } 117 }
118 118
119 syncer::ObjectIdSet object_ids; 119 syncer::ObjectIdSet object_ids;
120 object_ids.insert(object_id); 120 object_ids.insert(object_id);
121 syncer::ObjectIdInvalidationMap object_ids_with_states = 121 syncer::ObjectIdInvalidationMap object_ids_with_states =
122 syncer::ObjectIdSetToInvalidationMap(object_ids, state); 122 syncer::ObjectIdSetToInvalidationMap(object_ids, version, state);
123 123
124 content::NotificationService::current()->Notify( 124 content::NotificationService::current()->Notify(
125 chrome::NOTIFICATION_SYNC_REFRESH_REMOTE, 125 chrome::NOTIFICATION_SYNC_REFRESH_REMOTE,
126 content::Source<Profile>(profile_), 126 content::Source<Profile>(profile_),
127 content::Details<const syncer::ObjectIdInvalidationMap>( 127 content::Details<const syncer::ObjectIdInvalidationMap>(
128 &object_ids_with_states)); 128 &object_ids_with_states));
129 } 129 }
130 130
131 void ProfileSyncServiceAndroid::OnStateChanged() { 131 void ProfileSyncServiceAndroid::OnStateChanged() {
132 // Notify the java world that our sync state has changed. 132 // Notify the java world that our sync state has changed.
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 ProfileSyncServiceAndroid* profile_sync_service_android = 494 ProfileSyncServiceAndroid* profile_sync_service_android =
495 new ProfileSyncServiceAndroid(env, obj); 495 new ProfileSyncServiceAndroid(env, obj);
496 profile_sync_service_android->Init(); 496 profile_sync_service_android->Init();
497 return reinterpret_cast<jint>(profile_sync_service_android); 497 return reinterpret_cast<jint>(profile_sync_service_android);
498 } 498 }
499 499
500 // static 500 // static
501 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { 501 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) {
502 return RegisterNativesImpl(env); 502 return RegisterNativesImpl(env);
503 } 503 }
OLDNEW
« no previous file with comments | « chrome/browser/invalidation/invalidation_service_android.cc ('k') | chrome/browser/sync/test/integration/sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698