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

Unified Diff: blimp/net/helium/vector_clock.cc

Issue 2382533002: Helium: Initial proto and Syncable interface definition (Closed)
Patch Set: test changes Created 4 years, 2 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 | « blimp/net/helium/vector_clock.h ('k') | blimp/net/helium/vector_clock_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/helium/vector_clock.cc
diff --git a/blimp/net/helium/vector_clock.cc b/blimp/net/helium/vector_clock.cc
index 6b13d28745bd93e1ddb8793b4097e0c275709e98..69e6765fafd266c162b4c7e3f4c07aa36ee6ade4 100644
--- a/blimp/net/helium/vector_clock.cc
+++ b/blimp/net/helium/vector_clock.cc
@@ -54,4 +54,15 @@ void VectorClock::IncrementLocal() {
local_revision_++;
}
+proto::VectorClockMessage VectorClock::ToProto() const {
+ proto::VectorClockMessage result;
+ result.set_local_revision(local_revision_);
+ result.set_remote_revision(remote_revision_);
+ return result;
+}
+
+VectorClock VectorClock::Invert() const {
+ return VectorClock(remote_revision_, local_revision_);
+}
+
} // namespace blimp
« no previous file with comments | « blimp/net/helium/vector_clock.h ('k') | blimp/net/helium/vector_clock_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698