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

Unified Diff: sync/sessions/data_type_tracker.h

Issue 322333004: sync: Inject sync/'s dependency on invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/notifier/dropped_invalidation_tracker.cc ('k') | sync/sessions/data_type_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/data_type_tracker.h
diff --git a/sync/sessions/data_type_tracker.h b/sync/sessions/data_type_tracker.h
index 59ec9932d0659d65492744672dd4bc3d866b5b01..8d78cde2bd020877e5b3f25693a9b26262f4546d 100644
--- a/sync/sessions/data_type_tracker.h
+++ b/sync/sessions/data_type_tracker.h
@@ -1,32 +1,30 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//
-// A class to track the per-type scheduling data.
+
#ifndef SYNC_SESSIONS_DATA_TYPE_TRACKER_H_
#define SYNC_SESSIONS_DATA_TYPE_TRACKER_H_
-#include <deque>
#include <string>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
-#include "sync/notifier/dropped_invalidation_tracker.h"
-#include "sync/notifier/single_object_invalidation_set.h"
+#include "sync/internal_api/public/base/invalidation_interface.h"
+#include "sync/internal_api/public/base/model_type.h"
#include "sync/protocol/sync.pb.h"
namespace syncer {
-class Invalidation;
-class SingleObjectInvalidationSet;
+class InvalidationInterface;
namespace sessions {
-typedef std::deque<std::string> PayloadList;
-
+// A class to track the per-type scheduling data.
class DataTypeTracker {
public:
- explicit DataTypeTracker(const invalidation::ObjectId& object_id);
+ explicit DataTypeTracker();
~DataTypeTracker();
// For STL compatibility, we do not forbid the creation of a default copy
@@ -39,8 +37,7 @@ class DataTypeTracker {
void RecordLocalRefreshRequest();
// Tracks that we received invalidation notifications for this type.
- void RecordRemoteInvalidations(
- const SingleObjectInvalidationSet& invalidations);
+ void RecordRemoteInvalidation(scoped_ptr<InvalidationInterface> incoming);
// Records that a sync cycle has been performed successfully.
// Generally, this means that all local changes have been committed and all
@@ -105,7 +102,9 @@ class DataTypeTracker {
// The list of invalidations received since the last successful sync cycle.
// This list may be incomplete. See also:
// drop_tracker_.IsRecoveringFromDropEvent() and server_payload_overflow_.
- SingleObjectInvalidationSet pending_invalidations_;
+ //
+ // This list takes ownership of its contents.
+ ScopedVector<InvalidationInterface> pending_invalidations_;
size_t payload_buffer_size_;
@@ -114,10 +113,12 @@ class DataTypeTracker {
base::TimeTicks unthrottle_time_;
// A helper to keep track invalidations we dropped due to overflow.
- DroppedInvalidationTracker drop_tracker_;
+ scoped_ptr<InvalidationInterface> last_dropped_invalidation_;
+
+ DISALLOW_COPY_AND_ASSIGN(DataTypeTracker);
};
-} // namespace syncer
} // namespace sessions
+} // namespace syncer
#endif // SYNC_SESSIONS_DATA_TYPE_TRACKER_H_
« no previous file with comments | « sync/notifier/dropped_invalidation_tracker.cc ('k') | sync/sessions/data_type_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698