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

Issue 2439403003: Refactor BlimpConnection to TCPConnection (Closed)

Created:
4 years, 1 month ago by perumaal
Modified:
4 years, 1 month ago
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor BlimpConnection to TCPConnection as we move from one TCP-based API to a new Stream-based API * BlimpConnection is now an abstract class. * TCPConnection and tests are moved out of BlimpConnection. * BlimpConnection no longer knows about TCP-related classes including MessagePort and such. * Also in this CL: Skeleton gRPC plugin points. * Fixed all unit-tests. The overall idea is to enable gRPC support in Blimp. This is the first of a few CLs. In this CL I tease apart the existing BlimpConnection and BlimpTransport into the specific TCPConnection and TCP*Transport classes. Next, I will introduce GrpcConnection and GrpcTransport that will use allow passing of BlimpMessages through Grpc layer. However, internally, GrpcConnection and GrpcTransport will use the new GrpcStream which implements the checked in HeliumStream interface. Once this settles, the BlimpConnection and BlimpTransport-related classes (specifically, TCP/SSL/etc classes) will be removed and only the Helium-based transport mechanism will be used. Initially though the Helium protocol settles, this will first involve removing the TCP* classes alone. Committed: https://crrev.com/bc6fa5a73536e3ccc06fd82c1b6d5da5a712223f Cr-Commit-Position: refs/heads/master@{#428227}

Patch Set 1 #

Patch Set 2 : Sync merge #

Total comments: 66

Patch Set 3 : Fixed code review comments - Still haven't removed gRPC code #

Patch Set 4 : Remove gRPC proto #

Patch Set 5 : Sync merge #

Total comments: 11

Patch Set 6 : CR Round 2 + formatting #

Total comments: 8

Patch Set 7 : CR Round 3 #

Patch Set 8 : Added missing Engine Transport #

Total comments: 31
Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -559 lines) Patch
M blimp/client/core/session/assignment_source.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M blimp/client/core/session/client_network_components.cc View 1 2 3 4 5 1 chunk +7 lines, -0 lines 2 comments Download
M blimp/client/public/session/assignment.h View 1 chunk +1 line, -0 lines 0 comments Download
M blimp/engine/app/switches.h View 1 chunk +3 lines, -0 lines 0 comments Download
M blimp/engine/app/switches.cc View 1 chunk +1 line, -0 lines 1 comment Download
M blimp/engine/browser_tests/blimp_browser_test.cc View 1 2 1 chunk +2 lines, -0 lines 2 comments Download
M blimp/engine/session/blimp_engine_session.cc View 1 2 4 chunks +22 lines, -7 lines 0 comments Download
M blimp/net/BUILD.gn View 1 2 3 4 5 6 chunks +7 lines, -1 line 0 comments Download
M blimp/net/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M blimp/net/blimp_connection.h View 1 2 3 chunks +8 lines, -11 lines 2 comments Download
M blimp/net/blimp_connection.cc View 1 2 3 chunks +7 lines, -99 lines 1 comment Download
D blimp/net/blimp_connection_unittest.cc View 1 chunk +0 lines, -230 lines 0 comments Download
A blimp/net/blimp_engine_transport.h View 1 2 3 4 5 6 7 1 chunk +27 lines, -0 lines 2 comments Download
M blimp/net/blimp_transport.h View 1 2 3 4 5 2 chunks +5 lines, -5 lines 0 comments Download
M blimp/net/client_connection_manager.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M blimp/net/client_connection_manager_unittest.cc View 1 2 5 chunks +29 lines, -18 lines 0 comments Download
M blimp/net/engine_connection_manager.h View 1 2 2 chunks +13 lines, -7 lines 4 comments Download
M blimp/net/engine_connection_manager.cc View 1 2 3 4 5 6 1 chunk +28 lines, -16 lines 5 comments Download
M blimp/net/engine_connection_manager_unittest.cc View 1 2 3 4 5 2 chunks +14 lines, -44 lines 0 comments Download
M blimp/net/ssl_client_transport.cc View 1 chunk +0 lines, -1 line 0 comments Download
M blimp/net/stream_packet_reader.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M blimp/net/tcp_client_transport.h View 1 chunk +4 lines, -1 line 1 comment Download
M blimp/net/tcp_client_transport.cc View 1 2 2 chunks +5 lines, -1 line 1 comment Download
A blimp/net/tcp_connection.h View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 2 comments Download
A + blimp/net/tcp_connection.cc View 1 2 3 4 5 6 4 chunks +16 lines, -80 lines 2 comments Download
A + blimp/net/tcp_connection_unittest.cc View 1 2 3 4 5 6 10 chunks +17 lines, -22 lines 0 comments Download
M blimp/net/tcp_engine_transport.h View 1 2 3 4 5 3 chunks +7 lines, -5 lines 2 comments Download
M blimp/net/tcp_engine_transport.cc View 1 2 2 chunks +7 lines, -2 lines 2 comments Download
M blimp/net/tcp_transport_unittest.cc View 1 2 1 chunk +1 line, -1 line 1 comment Download
M blimp/net/test_common.h View 2 chunks +8 lines, -1 line 0 comments Download
M blimp/net/test_common.cc View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
A build/args/blimp_linux_client.gn View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 1 comment Download

Messages

Total messages: 61 (32 generated)
perumaal
PTAL, thanks!
4 years, 1 month ago (2016-10-25 00:38:16 UTC) #8
Garrett Casto
General refactoring is nice. Mostly nits and some test questions. https://codereview.chromium.org/2439403003/diff/20001/blimp/client/core/session/client_network_components.cc File blimp/client/core/session/client_network_components.cc (right): https://codereview.chromium.org/2439403003/diff/20001/blimp/client/core/session/client_network_components.cc#newcode38 ...
4 years, 1 month ago (2016-10-25 18:33:50 UTC) #12
Kevin M
https://codereview.chromium.org/2439403003/diff/20001/blimp/client/core/session/client_network_components.cc File blimp/client/core/session/client_network_components.cc (right): https://codereview.chromium.org/2439403003/diff/20001/blimp/client/core/session/client_network_components.cc#newcode38 blimp/client/core/session/client_network_components.cc:38: auto endpoint = assignment.engine_endpoint.ToString(); Just inline this in VLOG? ...
4 years, 1 month ago (2016-10-25 18:49:23 UTC) #13
Kevin M
Also, a general point - can you write a few sentences in the description that ...
4 years, 1 month ago (2016-10-25 18:50:18 UTC) #14
perumaal
PTAL thanks! General note on the port-number: I have added back the GetLocalAddress but to ...
4 years, 1 month ago (2016-10-25 23:02:40 UTC) #16
perumaal
Fixed a gRPC issue (https://github.com/grpc/grpc/pull/8490) and merged into Chromium. Retrying CQ bots now.
4 years, 1 month ago (2016-10-26 00:50:31 UTC) #19
Garrett Casto
Mostly nits. I realize there are still some open questions around how to handle ports ...
4 years, 1 month ago (2016-10-26 23:43:48 UTC) #22
perumaal
PTAL. Addressed Garrett's comments. https://codereview.chromium.org/2439403003/diff/80001/blimp/client/core/session/client_network_components.cc File blimp/client/core/session/client_network_components.cc (right): https://codereview.chromium.org/2439403003/diff/80001/blimp/client/core/session/client_network_components.cc#newcode55 blimp/client/core/session/client_network_components.cc:55: NOTIMPLEMENTED() << "Not yet implemented!"; ...
4 years, 1 month ago (2016-10-27 00:16:05 UTC) #23
Garrett Casto
lgtm https://codereview.chromium.org/2439403003/diff/80001/blimp/engine/session/blimp_engine_session.cc File blimp/engine/session/blimp_engine_session.cc (right): https://codereview.chromium.org/2439403003/diff/80001/blimp/engine/session/blimp_engine_session.cc#newcode219 blimp/engine/session/blimp_engine_session.cc:219: connection_manager_->ConnectTransport(&address, GetTransportType()); On 2016/10/27 00:16:04, perumaal wrote: > ...
4 years, 1 month ago (2016-10-27 16:45:45 UTC) #24
perumaal
On 2016/10/27 16:45:45, Garrett Casto wrote: > lgtm > > https://codereview.chromium.org/2439403003/diff/80001/blimp/engine/session/blimp_engine_session.cc > File blimp/engine/session/blimp_engine_session.cc (right): ...
4 years, 1 month ago (2016-10-27 17:36:38 UTC) #25
perumaal1
On 2016/10/27 17:36:38, perumaal wrote: > On 2016/10/27 16:45:45, Garrett Casto wrote: > > lgtm ...
4 years, 1 month ago (2016-10-27 17:48:49 UTC) #26
Kevin M
https://codereview.chromium.org/2439403003/diff/20001/blimp/net/tcp_connection.cc File blimp/net/tcp_connection.cc (right): https://codereview.chromium.org/2439403003/diff/20001/blimp/net/tcp_connection.cc#newcode72 blimp/net/tcp_connection.cc:72: const auto msg_byte_size = message->ByteSize(); On 2016/10/25 23:02:40, perumaal ...
4 years, 1 month ago (2016-10-27 18:08:04 UTC) #27
perumaal
@Wez: Please look at build/args/blimp_linux_client.gn. @Kevin: Addressed your comments. https://codereview.chromium.org/2439403003/diff/20001/blimp/net/tcp_connection.cc File blimp/net/tcp_connection.cc (right): https://codereview.chromium.org/2439403003/diff/20001/blimp/net/tcp_connection.cc#newcode72 blimp/net/tcp_connection.cc:72: ...
4 years, 1 month ago (2016-10-27 18:45:12 UTC) #29
perumaal
https://codereview.chromium.org/2439403003/diff/100001/blimp/net/blimp_connection.cc File blimp/net/blimp_connection.cc (right): https://codereview.chromium.org/2439403003/diff/100001/blimp/net/blimp_connection.cc#newcode102 blimp/net/blimp_connection.cc:102: for (auto& observer : error_observers_) { On 2016/10/27 18:08:03, ...
4 years, 1 month ago (2016-10-27 18:47:38 UTC) #30
Kevin M
lgtm
4 years, 1 month ago (2016-10-27 18:48:19 UTC) #31
perumaal1
Actually realized that current reviewers cannot grant l-g-t-m to build/args. @brucedawson: PTAL at build/args/blimp_linux_client.gn thanks!
4 years, 1 month ago (2016-10-27 21:08:10 UTC) #41
brucedawson
build/args/blimp_linux_client.gn lgtm to me
4 years, 1 month ago (2016-10-27 23:09:50 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2439403003/140001
4 years, 1 month ago (2016-10-27 23:59:31 UTC) #47
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 1 month ago (2016-10-28 00:06:04 UTC) #49
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/bc6fa5a73536e3ccc06fd82c1b6d5da5a712223f Cr-Commit-Position: refs/heads/master@{#428227}
4 years, 1 month ago (2016-10-28 00:09:33 UTC) #51
Dirk Pranke
lgtm also.
4 years, 1 month ago (2016-10-28 00:27:24 UTC) #52
Wez
Sorry, I didn't get a chance to review this at the time. https://codereview.chromium.org/2439403003/diff/140001/blimp/client/core/session/client_network_components.cc File blimp/client/core/session/client_network_components.cc ...
4 years, 1 month ago (2016-11-09 22:47:18 UTC) #53
Wez
https://codereview.chromium.org/2439403003/diff/140001/blimp/net/tcp_engine_transport.h File blimp/net/tcp_engine_transport.h (right): https://codereview.chromium.org/2439403003/diff/140001/blimp/net/tcp_engine_transport.h#newcode39 blimp/net/tcp_engine_transport.h:39: void GetLocalAddress(net::IPEndPoint* address) const override; If we're not allowing ...
4 years, 1 month ago (2016-11-09 22:57:27 UTC) #54
Wez
https://codereview.chromium.org/2439403003/diff/140001/blimp/net/engine_connection_manager.cc File blimp/net/engine_connection_manager.cc (right): https://codereview.chromium.org/2439403003/diff/140001/blimp/net/engine_connection_manager.cc#newcode49 blimp/net/engine_connection_manager.cc:49: base::Unretained(transport_.get()))); We should fix GetLocalAddress to trigger the Bind(), ...
4 years, 1 month ago (2016-11-09 23:25:49 UTC) #55
Wez
https://codereview.chromium.org/2439403003/diff/140001/blimp/net/engine_connection_manager.cc File blimp/net/engine_connection_manager.cc (right): https://codereview.chromium.org/2439403003/diff/140001/blimp/net/engine_connection_manager.cc#newcode49 blimp/net/engine_connection_manager.cc:49: base::Unretained(transport_.get()))); On 2016/11/09 23:25:49, Wez wrote: > We should ...
4 years, 1 month ago (2016-11-10 01:25:06 UTC) #56
perumaal
It's not clear from the CL I sent but most of the code is exactly ...
4 years, 1 month ago (2016-11-10 01:48:31 UTC) #57
perumaal
Adding comments first. I will address them next. https://codereview.chromium.org/2439403003/diff/140001/blimp/client/core/session/client_network_components.cc File blimp/client/core/session/client_network_components.cc (right): https://codereview.chromium.org/2439403003/diff/140001/blimp/client/core/session/client_network_components.cc#newcode55 blimp/client/core/session/client_network_components.cc:55: NOTIMPLEMENTED(); ...
4 years, 1 month ago (2016-11-10 02:05:05 UTC) #58
scf
https://codereview.chromium.org/2439403003/diff/140001/blimp/engine/app/switches.cc File blimp/engine/app/switches.cc (right): https://codereview.chromium.org/2439403003/diff/140001/blimp/engine/app/switches.cc#newcode12 blimp/engine/app/switches.cc:12: const char kEngineTransport[] = "engine-transport"; this is the transport ...
4 years, 1 month ago (2016-11-10 21:59:10 UTC) #60
perumaal
4 years, 1 month ago (2016-11-11 01:50:55 UTC) #61
Message was sent while issue was closed.
Still addressing, no CL yet.

https://codereview.chromium.org/2439403003/diff/140001/blimp/net/engine_conne...
File blimp/net/engine_connection_manager.cc (right):

https://codereview.chromium.org/2439403003/diff/140001/blimp/net/engine_conne...
blimp/net/engine_connection_manager.cc:29: void
EngineConnectionManager::ConnectTransport(
On 2016/11/10 21:59:09, scf wrote:
> Rename to CreateAndConnectTransport?

Good point.

https://codereview.chromium.org/2439403003/diff/140001/blimp/net/tcp_engine_t...
File blimp/net/tcp_engine_transport.cc (right):

https://codereview.chromium.org/2439403003/diff/140001/blimp/net/tcp_engine_t...
blimp/net/tcp_engine_transport.cc:69: std::unique_ptr<BlimpConnection>
TCPEngineTransport::MakeConnection() {
On 2016/11/10 21:59:10, scf wrote:
> rename to CreateConnection ?

We had a discussion around this before. I learnt that CreateConnection is an
ambiguous name as it implied the TCP connection creation.

Powered by Google App Engine
This is Rietveld 408576698