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

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

Issue 23441042: Refactor common invalidation framework types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another browser test fix Created 7 years, 2 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 | Annotate | Revision Log
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 ObjectIdVersionMap::iterator it = 111 ObjectIdVersionMap::iterator it =
112 max_invalidation_versions_.find(object_id); 112 max_invalidation_versions_.find(object_id);
113 if ((it != max_invalidation_versions_.end()) && 113 if ((it != max_invalidation_versions_.end()) &&
114 (version <= it->second)) { 114 (version <= it->second)) {
115 DVLOG(1) << "Dropping redundant invalidation with version " << version; 115 DVLOG(1) << "Dropping redundant invalidation with version " << version;
116 return; 116 return;
117 } 117 }
118 max_invalidation_versions_[object_id] = version; 118 max_invalidation_versions_[object_id] = version;
119 } 119 }
120 120
121 syncer::ObjectIdSet object_ids; 121 syncer::ObjectIdInvalidationMap object_ids_with_states;
122 object_ids.insert(object_id); 122 object_ids_with_states.Insert(
123 syncer::ObjectIdInvalidationMap object_ids_with_states = 123 syncer::Invalidation::Init(object_id, version, state));
Steve Condie 2013/10/01 18:53:10 It is possible for the version coming from the Jav
rlarocque 2013/10/01 19:29:57 Thanks for double-checking this. The compiler als
124 syncer::ObjectIdSetToInvalidationMap(object_ids, version, state);
125 124
126 content::NotificationService::current()->Notify( 125 content::NotificationService::current()->Notify(
127 chrome::NOTIFICATION_SYNC_REFRESH_REMOTE, 126 chrome::NOTIFICATION_SYNC_REFRESH_REMOTE,
128 content::Source<Profile>(profile_), 127 content::Source<Profile>(profile_),
129 content::Details<const syncer::ObjectIdInvalidationMap>( 128 content::Details<const syncer::ObjectIdInvalidationMap>(
130 &object_ids_with_states)); 129 &object_ids_with_states));
131 } 130 }
132 131
133 void ProfileSyncServiceAndroid::OnStateChanged() { 132 void ProfileSyncServiceAndroid::OnStateChanged() {
134 // Notify the java world that our sync state has changed. 133 // Notify the java world that our sync state has changed.
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 ProfileSyncServiceAndroid* profile_sync_service_android = 516 ProfileSyncServiceAndroid* profile_sync_service_android =
518 new ProfileSyncServiceAndroid(env, obj); 517 new ProfileSyncServiceAndroid(env, obj);
519 profile_sync_service_android->Init(); 518 profile_sync_service_android->Init();
520 return reinterpret_cast<jint>(profile_sync_service_android); 519 return reinterpret_cast<jint>(profile_sync_service_android);
521 } 520 }
522 521
523 // static 522 // static
524 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { 523 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) {
525 return RegisterNativesImpl(env); 524 return RegisterNativesImpl(env);
526 } 525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698