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

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

Issue 2382533002: Helium: Initial proto and Syncable interface definition (Closed)
Patch Set: Initial proto and Syncable interface definition 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..41fcf0fffcc5f6fdc122d95ced5ff4f57a9393a8 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::VectorClock VectorClock::CreateProto() {
+ helium::VectorClock result;
CJ 2016/09/29 20:36:55 Is helium::VectorClock the message? Hard to tell.
scf 2016/09/29 23:13:39 I was following the convention of other proto file
CJ 2016/09/29 23:44:00 The file names leave off the "message" part, but t
scf 2016/09/30 17:26:23 HeliumMessage sounds good?
CJ 2016/09/30 19:47:12 Well, this is for a VectorClock message right? So
scf 2016/09/30 22:13:23 talked offline. Suffixing everything to contain Me
+ 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