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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 23441042: Refactor common invalidation framework types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/glue/sync_backend_host.h" 5 #include "chrome/browser/sync/glue/sync_backend_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 void SyncBackendHost::OnInvalidatorStateChange(syncer::InvalidatorState state) { 1487 void SyncBackendHost::OnInvalidatorStateChange(syncer::InvalidatorState state) {
1488 registrar_->sync_thread()->message_loop()->PostTask( 1488 registrar_->sync_thread()->message_loop()->PostTask(
1489 FROM_HERE, 1489 FROM_HERE,
1490 base::Bind(&SyncBackendHost::Core::DoOnInvalidatorStateChange, 1490 base::Bind(&SyncBackendHost::Core::DoOnInvalidatorStateChange,
1491 core_.get(), 1491 core_.get(),
1492 state)); 1492 state));
1493 } 1493 }
1494 1494
1495 void SyncBackendHost::OnIncomingInvalidation( 1495 void SyncBackendHost::OnIncomingInvalidation(
1496 const syncer::ObjectIdInvalidationMap& invalidation_map) { 1496 const syncer::ObjectIdInvalidationMap& invalidation_map) {
1497 // TODO(dcheng): Acknowledge immediately for now. Fix this once the 1497 // TODO(rlarocque): Acknowledge these invalidations only after the syncer has
1498 // invalidator doesn't repeatedly ping for unacknowledged invaliations, since 1498 // acted on them and saved the results to disk.
1499 // it conflicts with the sync scheduler's internal backoff algorithm. 1499 syncer::ObjectIdSet ids = invalidation_map.GetObjectIds();
1500 // See http://crbug.com/124149 for more information. 1500 for (syncer::ObjectIdSet::const_iterator it = ids.begin();
1501 for (syncer::ObjectIdInvalidationMap::const_iterator it = 1501 it != ids.end(); ++it) {
1502 invalidation_map.begin(); it != invalidation_map.end(); ++it) { 1502 const syncer::AckHandle& handle =
1503 invalidator_->AcknowledgeInvalidation(it->first, it->second.ack_handle); 1503 invalidation_map.ForObject(*it).back().GetAckHandle();
1504 invalidator_->AcknowledgeInvalidation(*it, handle);
1504 } 1505 }
1505 1506
1506 registrar_->sync_thread()->message_loop()->PostTask( 1507 registrar_->sync_thread()->message_loop()->PostTask(
1507 FROM_HERE, 1508 FROM_HERE,
1508 base::Bind(&SyncBackendHost::Core::DoOnIncomingInvalidation, 1509 base::Bind(&SyncBackendHost::Core::DoOnIncomingInvalidation,
1509 core_.get(), 1510 core_.get(),
1510 invalidation_map)); 1511 invalidation_map));
1511 } 1512 }
1512 1513
1513 bool SyncBackendHost::CheckPassphraseAgainstCachedPendingKeys( 1514 bool SyncBackendHost::CheckPassphraseAgainstCachedPendingKeys(
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 1606
1606 base::MessageLoop* SyncBackendHost::GetSyncLoopForTesting() { 1607 base::MessageLoop* SyncBackendHost::GetSyncLoopForTesting() {
1607 return registrar_->sync_thread()->message_loop(); 1608 return registrar_->sync_thread()->message_loop();
1608 } 1609 }
1609 1610
1610 #undef SDVLOG 1611 #undef SDVLOG
1611 1612
1612 #undef SLOG 1613 #undef SLOG
1613 1614
1614 } // namespace browser_sync 1615 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698