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

Issue 7762008: Implement STUN support for P2P Transport API. (Closed)

Created:
9 years, 4 months ago by Sergey Ulanov
Modified:
9 years, 3 months ago
Reviewers:
jam, Wez
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Implement STUN support for P2P Transport API. BUG=41776 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98827

Patch Set 1 #

Patch Set 2 : - #

Total comments: 21

Patch Set 3 : - #

Patch Set 4 : - #

Patch Set 5 : - #

Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -11 lines) Patch
M content/content_renderer.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/p2p/host_address_request.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/p2p/p2p_transport_impl.h View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M content/renderer/p2p/p2p_transport_impl.cc View 1 2 4 chunks +16 lines, -5 lines 0 comments Download
A content/renderer/p2p/port_allocator.h View 1 2 3 4 1 chunk +65 lines, -0 lines 0 comments Download
A content/renderer/p2p/port_allocator.cc View 1 2 3 4 1 chunk +87 lines, -0 lines 0 comments Download
M webkit/glue/p2p_transport.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M webkit/glue/p2p_transport.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_transport_impl.cc View 1 2 3 chunks +11 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Sergey Ulanov
jam: please approve gyp changes wez: please review code in content/renderer/p2p
9 years, 4 months ago (2011-08-26 22:33:52 UTC) #1
jam
On 2011/08/26 22:33:52, sergeyu wrote: > jam: please approve gyp changes actually, you don't need ...
9 years, 4 months ago (2011-08-26 23:38:50 UTC) #2
Wez
LGTM but please see comments below. http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_transport_impl.cc File content/renderer/p2p/p2p_transport_impl.cc (right): http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_transport_impl.cc#newcode65 content/renderer/p2p/p2p_transport_impl.cc:65: // Use raw ...
9 years, 3 months ago (2011-08-29 18:01:57 UTC) #3
Sergey Ulanov
9 years, 3 months ago (2011-08-29 22:13:39 UTC) #4
http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_tra...
File content/renderer/p2p/p2p_transport_impl.cc (right):

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_tra...
content/renderer/p2p/p2p_transport_impl.cc:65: // Use raw basic port allocator
is used for tests.
On 2011/08/29 18:01:57, Wez wrote:
> This comment needs rewording, although it could just be removed, I think,
since
> the test-only limitation is specified on the ctor definition already.

I think it's useful to have this comment here.

> Is the P2P vs Basic port allocator usage here correct?  What does an
application
> do if it wants LAN-only peer-to-peer?  Seems preferable to avoid unnecessary
> work on STUN, etc, in that case?
I plan to add flags to disable/enable certain types of ports. These flags will
be passed to P2PPortAllocator (as part of |config|). P2PPortAllocator will not
do any additional work if some ports are disabled.

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_tra...
File content/renderer/p2p/p2p_transport_impl.h (right):

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_tra...
content/renderer/p2p/p2p_transport_impl.h:42: // Create P2PTransportImpl using
specified NetworkManager and
On 2011/08/29 18:01:57, Wez wrote:
> nit: Create->Creates.

Done.

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/p2p_tra...
content/renderer/p2p/p2p_transport_impl.h:44: // |socket_factory|. Must be used
for tests only.
On 2011/08/29 18:01:57, Wez wrote:
> You mean it's provided only for use by tests?

Done.

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
File content/renderer/p2p/port_allocator.cc (right):

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.cc:49: // started immediately.
On 2011/08/29 18:01:57, Wez wrote:
> nit: Missing "an" and "a".

Done.

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.cc:55: // TODO(sergeyu): Implement relay
server support.
On 2011/08/29 18:01:57, Wez wrote:
> Do you have a bug created to track that?
No, but I have a CL :)
There is crbug.com/41776 all work on this API.

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.cc:66: << allocator_->config_.stun_server;
On 2011/08/29 18:01:57, Wez wrote:
> Shouldn't this expose an error to the caller, rather than logging?
Yes, It should. I moved this to ppb_transport_impl.cc

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.cc:72: new
P2PHostAddressRequest(allocator_->socket_dispatcher_);
On 2011/08/29 18:01:57, Wez wrote:
> Could this request class have a more descriptive name, e.g. 
> P2PHostnameResolver?
Added TODO for this in host_address_request.h.

> 
> I think you need to be careful in the P2P code about using the term "host",
> since it is so often used to refer to the end of a P2P connection that is not
> the initiator. 
There is no notion of initiator in the Transport API: it is symmetric in terms
of how the API is used on then ends. But, yes, I see how this term may be
confusing in this context.

> Initially I had assumed that this class was responsible for
> doing STUN, because it sounded like it determined this P2P host's address. :)

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.cc:78: void
P2PPortAllocatorSession::OnStunAddress(
On 2011/08/29 18:01:57, Wez wrote:
> nit: OnStunAddress->OnStunHostAddress.

Renamed it to OnStunServerAddress

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.cc:82: net::IPEndPoint(address,
stun_server_port_), &socket_address)) {
On 2011/08/29 18:01:57, Wez wrote:
> nit: I'd wrap &socket_address, too, for readability.

Done.

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
File content/renderer/p2p/port_allocator.h (right):

http://codereview.chromium.org/7762008/diff/2001/content/renderer/p2p/port_al...
content/renderer/p2p/port_allocator.h:49: // Override for
cricket::BasicPortAllocatorSession::GetPortConfigurations().
On 2011/08/29 18:01:57, Wez wrote:
> nit: Does this comment add anything?
I think it's useful to annotate overridden methods to make it clear which
methods they override. It may be redundant in this case because there is only
one parent class, but I think it's better to keep it for consistency. I've
changed it to "Overrides for cricket::BasicPortAllocatorSession."

Powered by Google App Engine
This is Rietveld 408576698