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

Side by Side Diff: sync/internal_api/public/base/invalidation.h

Issue 322333004: sync: Inject sync/'s dependency on invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // re-deliver this invalidation in the event of a crash or restart. 77 // re-deliver this invalidation in the event of a crash or restart.
78 void Acknowledge() const; 78 void Acknowledge() const;
79 79
80 // Informs the ack tracker that this invalidation will not be serviced. 80 // Informs the ack tracker that this invalidation will not be serviced.
81 // 81 //
82 // If a client's buffer reaches its limit and it is forced to start dropping 82 // If a client's buffer reaches its limit and it is forced to start dropping
83 // invalidations, it should call this function before dropping its 83 // invalidations, it should call this function before dropping its
84 // invalidations in order to allow the ack tracker to drop the invalidation, 84 // invalidations in order to allow the ack tracker to drop the invalidation,
85 // too. 85 // too.
86 // 86 //
87 // The drop record will be tracked by the specified 87 // To indicate recovery from a drop event, the client should call
88 // DroppedInvalidationTracker. The caller should hang on to this tracker. It 88 // Acknowledge()
89 // will need to use it when it recovers from this drop event, or if it needs 89 // on the most recently dropped inavlidation.
90 // to record another drop event for the same ObjectID. Refer to the 90 void Drop();
91 // documentation of DroppedInvalidationTracker for more details.
92 void Drop(DroppedInvalidationTracker* tracker) const;
93 91
94 scoped_ptr<base::DictionaryValue> ToValue() const; 92 scoped_ptr<base::DictionaryValue> ToValue() const;
95 std::string ToString() const; 93 std::string ToString() const;
96 94
97 private: 95 private:
98 Invalidation(const invalidation::ObjectId& id, 96 Invalidation(const invalidation::ObjectId& id,
99 bool is_unknown_version, 97 bool is_unknown_version,
100 int64 version, 98 int64 version,
101 const std::string& payload, 99 const std::string& payload,
102 AckHandle ack_handle); 100 AckHandle ack_handle);
(...skipping 13 matching lines...) Expand all
116 std::string payload_; 114 std::string payload_;
117 115
118 // A locally generated unique ID used to manage local acknowledgements. 116 // A locally generated unique ID used to manage local acknowledgements.
119 AckHandle ack_handle_; 117 AckHandle ack_handle_;
120 syncer::WeakHandle<AckHandler> ack_handler_; 118 syncer::WeakHandle<AckHandler> ack_handler_;
121 }; 119 };
122 120
123 } // namespace syncer 121 } // namespace syncer
124 122
125 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ 123 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698