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

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

Issue 2382533002: Helium: Initial proto and Syncable interface definition (Closed)
Patch Set: https://memegen.googleplex.com/4141705 Created 4 years, 3 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
« blimp/net/helium/vector_clock.h ('K') | « blimp/net/helium/vector_clock.h ('k') | no next file » | 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..12eccd5de45c7b06b3176a90d74cb046bc399144 100644
--- a/blimp/net/helium/vector_clock.cc
+++ b/blimp/net/helium/vector_clock.cc
@@ -54,4 +54,18 @@ void VectorClock::IncrementLocal() {
local_revision_++;
}
+helium::VectorClockMessage VectorClock::ToProto() {
+ helium::VectorClockMessage result;
+ result.set_local_revision(local_revision_);
+ result.set_remote_revision(remote_revision_);
+ return result;
+}
+
+VectorClock VectorClock::Invert() {
+ VectorClock result;
+ result.set_local_revision(remote_revision_);
+ result.set_remote_revision(local_revision_);
+ return result;
+}
+
} // namespace blimp
« blimp/net/helium/vector_clock.h ('K') | « blimp/net/helium/vector_clock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698