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

Side by Side Diff: sync/notifier/mock_ack_handler.cc

Issue 56113003: Implement new invalidations ack tracking system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More review fixes Created 7 years 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 "sync/notifier/mock_ack_handler.h" 5 #include "sync/notifier/mock_ack_handler.h"
6 6
7 #include "sync/internal_api/public/base/ack_handle.h" 7 #include "sync/internal_api/public/base/ack_handle.h"
8 #include "sync/internal_api/public/base/invalidation.h" 8 #include "sync/internal_api/public/base/invalidation.h"
9 9
10 namespace syncer { 10 namespace syncer {
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 30
31 MockAckHandler::MockAckHandler() {} 31 MockAckHandler::MockAckHandler() {}
32 32
33 MockAckHandler::~MockAckHandler() {} 33 MockAckHandler::~MockAckHandler() {}
34 34
35 void MockAckHandler::RegisterInvalidation(Invalidation* invalidation) { 35 void MockAckHandler::RegisterInvalidation(Invalidation* invalidation) {
36 unacked_invalidations_.push_back(*invalidation); 36 unacked_invalidations_.push_back(*invalidation);
37 invalidation->set_ack_handler(WeakHandleThis()); 37 invalidation->InitAckHandler(WeakHandleThis());
38 } 38 }
39 39
40 void MockAckHandler::RegisterUnsentInvalidation(Invalidation* invalidation) { 40 void MockAckHandler::RegisterUnsentInvalidation(Invalidation* invalidation) {
41 unsent_invalidations_.push_back(*invalidation); 41 unsent_invalidations_.push_back(*invalidation);
42 } 42 }
43 43
44 bool MockAckHandler::IsUnacked(const Invalidation& invalidation) const { 44 bool MockAckHandler::IsUnacked(const Invalidation& invalidation) const {
45 AckHandleMatcher matcher(invalidation.ack_handle()); 45 AckHandleMatcher matcher(invalidation.ack_handle());
46 InvalidationVector::const_iterator it = std::find_if( 46 InvalidationVector::const_iterator it = std::find_if(
47 unacked_invalidations_.begin(), 47 unacked_invalidations_.begin(),
(...skipping 28 matching lines...) Expand all
76 void MockAckHandler::Drop( 76 void MockAckHandler::Drop(
77 const invalidation::ObjectId& id, 77 const invalidation::ObjectId& id,
78 const AckHandle& handle) { 78 const AckHandle& handle) {
79 } 79 }
80 80
81 WeakHandle<AckHandler> MockAckHandler::WeakHandleThis() { 81 WeakHandle<AckHandler> MockAckHandler::WeakHandleThis() {
82 return WeakHandle<AckHandler>(AsWeakPtr()); 82 return WeakHandle<AckHandler>(AsWeakPtr());
83 } 83 }
84 84
85 } // namespace syncer 85 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698