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

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

Issue 40303005: Add code for new invalidation local ack system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another attempt at fixing win Created 7 years, 1 month 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
« no previous file with comments | « no previous file | sync/internal_api/public/base/invalidation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 int64 version() const; 47 int64 version() const;
48 48
49 // Safe to call only if is_unknown_version() returns false. 49 // Safe to call only if is_unknown_version() returns false.
50 const std::string& payload() const; 50 const std::string& payload() const;
51 51
52 const AckHandle& ack_handle() const; 52 const AckHandle& ack_handle() const;
53 53
54 // TODO(rlarocque): Remove this method and use AckHandlers instead. 54 // TODO(rlarocque): Remove this method and use AckHandlers instead.
55 void set_ack_handle(const AckHandle& ack_handle); 55 void set_ack_handle(const AckHandle& ack_handle);
56 56
57 // Functions from the alternative ack tracking framework.
58 // Currently unused.
57 void set_ack_handler(syncer::WeakHandle<AckHandler> ack_handler); 59 void set_ack_handler(syncer::WeakHandle<AckHandler> ack_handler);
60 bool SupportsAcknowledgement() const;
61 void Acknowledge() const;
58 62
59 // True if this class has a valid AckHandler. 63 // Drops an invalidation.
60 bool SupportsAcknowledgement() const; 64 //
61 65 // The drop record will be tracked by the specified
62 // TODO(rlarocque): Re-enable these when we switch to AckHandlers. 66 // DroppedInvalidationTracker. The caller should hang on to this tracker. It
63 // void Acknowledge() const; 67 // will need to use it when it recovers from this drop event. See the
64 // void Drop(DroppedInvalidationTracker* tracker) const; 68 // documentation of DroppedInvalidationTracker for more details.
69 void Drop(DroppedInvalidationTracker* tracker) const;
65 70
66 scoped_ptr<base::DictionaryValue> ToValue() const; 71 scoped_ptr<base::DictionaryValue> ToValue() const;
67 std::string ToString() const; 72 std::string ToString() const;
68 73
69 private: 74 private:
70 Invalidation(const invalidation::ObjectId& id, 75 Invalidation(const invalidation::ObjectId& id,
71 bool is_unknown_version, 76 bool is_unknown_version,
72 int64 version, 77 int64 version,
73 const std::string& payload, 78 const std::string& payload,
74 AckHandle ack_handle); 79 AckHandle ack_handle);
(...skipping 13 matching lines...) Expand all
88 std::string payload_; 93 std::string payload_;
89 94
90 // A locally generated unique ID used to manage local acknowledgements. 95 // A locally generated unique ID used to manage local acknowledgements.
91 AckHandle ack_handle_; 96 AckHandle ack_handle_;
92 syncer::WeakHandle<AckHandler> ack_handler_; 97 syncer::WeakHandle<AckHandler> ack_handler_;
93 }; 98 };
94 99
95 } // namespace syncer 100 } // namespace syncer
96 101
97 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_ 102 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_INVALIDATION_H_
OLDNEW
« no previous file with comments | « no previous file | sync/internal_api/public/base/invalidation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698