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

Side by Side 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 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/net/common.h" 5 #include "blimp/net/common.h"
6 6
7 #include <iostream>
8
9 #include "blimp/common/proto/blimp_message.pb.h"
10 #include "net/base/ip_address_number.h"
11
7 namespace blimp { 12 namespace blimp {
8 13
9 const size_t kMaxPacketPayloadSizeBytes = 1 << 16; // 64KB 14 const size_t kMaxPacketPayloadSizeBytes = 1 << 16; // 64KB
10 const size_t kPacketHeaderSizeBytes = 4; 15 const size_t kPacketHeaderSizeBytes = 4;
16 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.
17
18 net::IPAddressNumber GetIPv4AnyAddress() {
19 net::IPAddressNumber output;
20 output.push_back(0);
21 output.push_back(0);
22 output.push_back(0);
23 output.push_back(0);
24 return output;
25 }
26
27 std::ostream& operator<<(std::ostream& out, const BlimpMessage& message) {
28 // TODO(kmarshall): Log type-specific contextual detail.
29 out << "<BlimpMessage type=" << message.type()
30 << ", size=" << message.ByteSize() << ">";
31 return out;
32 }
11 33
12 } // namespace blimp 34 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698