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

Unified Diff: blimp/net/common.cc

Issue 1551583003: Implementation and fixes for Blimp client/engine E2E communication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dtrainor-linux-cl1528243002
Patch Set: Addressed haibin's feedback, made an ObserverList for ConnectionErrorObserver Created 5 years 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
Index: blimp/net/common.cc
diff --git a/blimp/net/common.cc b/blimp/net/common.cc
index 1663b300534f03ff610710b6d2630a5f7c04c427..4ba6c75c335c5bbe84fd5472d9e44b130b60157c 100644
--- a/blimp/net/common.cc
+++ b/blimp/net/common.cc
@@ -4,9 +4,31 @@
#include "blimp/net/common.h"
+#include <iostream>
+
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "net/base/ip_address_number.h"
+
namespace blimp {
const size_t kMaxPacketPayloadSizeBytes = 1 << 16; // 64KB
const size_t kPacketHeaderSizeBytes = 4;
+const uint16_t kDefaultTcpPort = 25467;
haibinlu 2016/01/04 19:45:45 this will be mapped to a different port in engine.
Kevin M 2016/01/04 20:42:13 Good point, removed it from common.h.
+
+net::IPAddressNumber GetIPv4AnyAddress() {
+ net::IPAddressNumber output;
+ output.push_back(0);
+ output.push_back(0);
+ output.push_back(0);
+ output.push_back(0);
+ return output;
+}
+
+std::ostream& operator<<(std::ostream& out, const BlimpMessage& message) {
+ // TODO(kmarshall): Log type-specific contextual detail.
+ out << "<BlimpMessage type=" << message.type()
+ << ", size=" << message.ByteSize() << ">";
+ return out;
+}
} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698