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

Issue 6711033: A new authenticated connection evicts an old one. (Closed)

Created:
9 years, 9 months ago by simonmorris
Modified:
7 years, 2 months ago
Reviewers:
Sergey Ulanov, awong
CC:
chromium-reviews, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, simonmorris+watch_chromium.org, wez+watch_chromium.org, Paweł Hajdan Jr., dmaclach+watch_chromium.org, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, ajwong+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

ChromotingHost can have multiple connections, but only one authenticated connection. When a connection is authenticated, the host disconnects all other connections. The result is that if a client has disconnected without the host noticing, another client can connect immediately, without having to wait for the older connection to time out. The new ClientSession class encapsulates a ConnectionToClient and per-client state. It has taken the HostStub implementation away from DesktopEnvironment. BUG=70013 TEST=extra unit test; also see repro steps in BUG Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=79114

Patch Set 1 #

Total comments: 6

Patch Set 2 : Factor out ClientSession. #

Patch Set 3 : Fix for Linux and Mac. #

Patch Set 4 : Fixes for Linux and Mac compilers. #

Patch Set 5 : Tidy. #

Patch Set 6 : Remove redundant member of HostMessageDispatcher. #

Total comments: 27

Patch Set 7 : Addressed reviewers' comments. #

Patch Set 8 : Sync. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -242 lines) Patch
M remoting/host/chromoting_host.h View 1 2 3 4 5 6 5 chunks +10 lines, -13 lines 0 comments Download
M remoting/host/chromoting_host.cc View 1 2 3 4 5 6 8 chunks +74 lines, -42 lines 0 comments Download
M remoting/host/chromoting_host_unittest.cc View 1 2 3 4 5 6 9 chunks +97 lines, -27 lines 0 comments Download
A remoting/host/client_session.h View 1 2 3 4 5 6 1 chunk +60 lines, -0 lines 0 comments Download
A remoting/host/client_session.cc View 1 2 3 4 5 6 1 chunk +66 lines, -0 lines 0 comments Download
M remoting/host/desktop_environment.h View 1 2 3 4 5 6 2 chunks +2 lines, -31 lines 0 comments Download
M remoting/host/desktop_environment.cc View 1 2 chunks +1 line, -40 lines 0 comments Download
M remoting/host/desktop_environment_fake.h View 1 1 chunk +0 lines, -29 lines 0 comments Download
M remoting/host/desktop_environment_fake.cc View 1 1 chunk +0 lines, -31 lines 0 comments Download
M remoting/protocol/connection_to_client.h View 1 2 3 4 5 6 3 chunks +11 lines, -4 lines 0 comments Download
M remoting/protocol/connection_to_client.cc View 1 2 3 4 5 6 4 chunks +14 lines, -3 lines 0 comments Download
M remoting/protocol/connection_to_client_unittest.cc View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M remoting/protocol/host_message_dispatcher.cc View 1 2 3 4 5 3 chunks +12 lines, -14 lines 0 comments Download
M remoting/protocol/host_stub.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M remoting/protocol/protocol_mock_objects.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M remoting/remoting.gyp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
simonmorris
9 years, 9 months ago (2011-03-18 10:58:25 UTC) #1
Sergey Ulanov
I disagree with the way you change HostStub interface. I think that if we want ...
9 years, 9 months ago (2011-03-18 18:12:21 UTC) #2
Sergey Ulanov
On Fri, Mar 18, 2011 at 11:12 AM, <sergeyu@chromium.org> wrote: > I disagree with the ...
9 years, 9 months ago (2011-03-18 18:20:50 UTC) #3
simonmorris
I've implemented a ClientSession class, as Sergey suggested. http://codereview.chromium.org/6711033/diff/1/remoting/protocol/host_control_sender.cc File remoting/protocol/host_control_sender.cc (right): http://codereview.chromium.org/6711033/diff/1/remoting/protocol/host_control_sender.cc#newcode34 remoting/protocol/host_control_sender.cc:34: void ...
9 years, 9 months ago (2011-03-22 13:09:09 UTC) #4
awong
Drive-by (no need to wait for me to re-review). Mostly some style issues. One potential ...
9 years, 9 months ago (2011-03-22 15:11:56 UTC) #5
Sergey Ulanov
Looks mostly good. One more nit in addition to alberts. I disagree with addition of ...
9 years, 9 months ago (2011-03-22 23:19:14 UTC) #6
simonmorris
On 2011/03/22 23:19:14, sergeyu wrote: > Looks mostly good. One more nit in addition to ...
9 years, 9 months ago (2011-03-23 09:17:52 UTC) #7
simonmorris
9 years, 9 months ago (2011-03-23 10:35:20 UTC) #8
http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
File remoting/host/chromoting_host.cc (left):

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:199: // TODO(hclam): Stop only if the last
connection disconnected.
On 2011/03/22 23:19:14, sergeyu wrote:
> I don't think we can remove this TODO yet. Recorder is still stopped if there
> are still active connections

Done.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
File remoting/host/chromoting_host.cc (right):

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:145: }
Added clients_.clear() .

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:183: // the recorder.
Clarified comment.

I don't think that scenario causes a problem.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:319: NULL,
Only in unit tests, and it's better to be more concise here
at the expense of verbosity there. Removed that parameter.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:386: std::vector<scoped_refptr<ClientSession> >
clients_copy(clients_);
On 2011/03/22 15:11:56, awong wrote:
> Add a note for why we need to copy |clients_|.

Done.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:395: DCHECK(recorder_.get() == NULL);
On 2011/03/22 15:11:56, awong wrote:
> This should be a hard requirement right?
> 
> I would CHECK fail here rather than DCHECK.  Otherwise, in release mode, we'd
> skip this, and happily reuse the old recorder below.

Done.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.cc:401: DCHECK(desktop_environment_->capturer());
A comment elsewhere suggests that this test is a relic of old
code. Deleted.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_host.h
File remoting/host/chromoting_host.h (right):

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host.h:125: void add_client(ClientSession* client) {
On 2011/03/22 15:11:56, awong wrote:
> Chromium style says, add_client() shoudl only be used if this is a trivial
> setter.  Please rename AddClient(), and take the implementation out-of-line.

Done.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
File remoting/host/chromoting_host_unittest.cc (right):

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host_unittest.cc:162: void
SimulateSecondClientConnection() {
Done (with CreateFunctor).

http://codereview.chromium.org/6711033/diff/6002/remoting/host/chromoting_hos...
remoting/host/chromoting_host_unittest.cc:290: InSequence s;
I think it's worth knowing that no video is sent to
connection 1 after any video is sent to connection 2: it's a
(weak) test that connection 1 has been disconnected.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/client_session.h
File remoting/host/client_session.h (right):

http://codereview.chromium.org/6711033/diff/6002/remoting/host/client_session...
remoting/host/client_session.h:42: // Disconnect this client.
On 2011/03/22 15:11:56, awong wrote:
> client -> Clientsession

Done.

http://codereview.chromium.org/6711033/diff/6002/remoting/host/client_session...
remoting/host/client_session.h:45: protocol::ConnectionToClient* connection();
On 2011/03/22 15:11:56, awong wrote:
> make a const method?

Done.

http://codereview.chromium.org/6711033/diff/6002/remoting/protocol/connection...
File remoting/protocol/connection_to_client.h (right):

http://codereview.chromium.org/6711033/diff/6002/remoting/protocol/connection...
remoting/protocol/connection_to_client.h:84: virtual ~ConnectionToClient();
Yes: this is a base class for MockConnectionToClient.

Powered by Google App Engine
This is Rietveld 408576698