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

Issue 9212047: Add GetBoundAddress to PPB_UDPSocket_Private (Closed)

Created:
8 years, 11 months ago by mtilburg1
Modified:
8 years, 10 months ago
CC:
chromium-reviews, jam, yzshen+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, ihf+watch_chromium.org
Visibility:
Public.

Description

GetBoundAddress will return the address that Bind actually bound to. If there has not been a successful call to Bind, this method will return an error. BUG=no bug TEST=udp tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=122910

Patch Set 1 #

Patch Set 2 : a few small changes after self review #

Total comments: 1

Patch Set 3 : Add GetBoundAddress to retrieve address we bound to. #

Total comments: 11

Patch Set 4 : add backward compatability to interface, fix other review comments #

Total comments: 4

Patch Set 5 : add ppapi versioning to nacl, add unit test(fix existing unit tests) #

Total comments: 6

Patch Set 6 : A few more changes via review #

Total comments: 14

Patch Set 7 : add a few more unit tests, updates from review #

Total comments: 11

Patch Set 8 : more changes via reviews #

Patch Set 9 : fix unit tests that were crashing on windows #

Total comments: 6

Patch Set 10 : No changes... rebasing to catch up to trunk #

Patch Set 11 : fix build error after rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+338 lines, -48 lines) Patch
M content/browser/renderer_host/pepper_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/pepper_udp_socket.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/renderer_host/pepper_udp_socket.cc View 1 2 3 4 5 6 3 chunks +24 lines, -5 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -4 lines 0 comments Download
M ppapi/api/private/ppb_udp_socket_private.idl View 1 2 3 4 5 6 7 2 chunks +10 lines, -1 line 0 comments Download
M ppapi/c/private/ppb_udp_socket_private.h View 1 2 3 4 5 6 7 5 chunks +31 lines, -4 lines 0 comments Download
M ppapi/cpp/private/udp_socket_private.h View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M ppapi/cpp/private/udp_socket_private.cc View 1 2 3 4 5 6 3 chunks +15 lines, -1 line 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc View 1 2 3 4 5 6 7 1 chunk +25 lines, -0 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -2 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.cc View 1 2 3 4 5 2 chunks +41 lines, -3 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc View 1 2 3 4 5 6 7 8 1 chunk +19 lines, -0 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc View 1 2 3 4 5 6 7 8 2 chunks +16 lines, -0 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/ppb_udp_socket_private.srpc View 1 2 3 4 5 6 2 chunks +8 lines, -1 line 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_udp_socket_private_proxy.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_udp_socket_private_proxy.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M ppapi/shared_impl/private/udp_socket_private_impl.h View 1 2 3 4 5 6 4 chunks +5 lines, -2 lines 0 comments Download
M ppapi/shared_impl/private/udp_socket_private_impl.cc View 1 2 3 4 5 6 7 8 9 4 chunks +17 lines, -2 lines 0 comments Download
M ppapi/tests/test_udp_socket_private_shared.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -2 lines 0 comments Download
M ppapi/tests/test_udp_socket_private_shared.cc View 1 2 3 4 5 6 7 8 6 chunks +52 lines, -5 lines 0 comments Download
M ppapi/thunk/interfaces_ppb_private.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_udp_socket_private_api.h View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M ppapi/thunk/ppb_udp_socket_private_thunk.cc View 1 2 3 4 3 chunks +25 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
mtilburg1
Trung/Yuzhu- A small change to the bind API that is necessary to retrieve the port ...
8 years, 11 months ago (2012-01-24 14:17:24 UTC) #1
yzshen1
https://chromiumcodereview.appspot.com/9212047/diff/3002/ppapi/api/private/ppb_udp_socket_private.idl File ppapi/api/private/ppb_udp_socket_private.idl (right): https://chromiumcodereview.appspot.com/9212047/diff/3002/ppapi/api/private/ppb_udp_socket_private.idl#newcode30 ppapi/api/private/ppb_udp_socket_private.idl:30: [in] PP_NetAddress_Private addr, - Isn't the port information included ...
8 years, 11 months ago (2012-01-27 18:41:07 UTC) #2
mtilburg1
On 2012/01/27 18:41:07, yzshen1 wrote: > https://chromiumcodereview.appspot.com/9212047/diff/3002/ppapi/api/private/ppb_udp_socket_private.idl > File ppapi/api/private/ppb_udp_socket_private.idl (right): > > https://chromiumcodereview.appspot.com/9212047/diff/3002/ppapi/api/private/ppb_udp_socket_private.idl#newcode30 > ...
8 years, 10 months ago (2012-02-01 12:43:06 UTC) #3
mtilburg1
Added GetBoundAddress, which will be the address (and port) that Bind actually bound to.
8 years, 10 months ago (2012-02-02 10:36:56 UTC) #4
yzshen1
On 2012/02/01 12:43:06, mtilburg1 wrote: > On 2012/01/27 18:41:07, yzshen1 wrote: > > > https://chromiumcodereview.appspot.com/9212047/diff/3002/ppapi/api/private/ppb_udp_socket_private.idl ...
8 years, 10 months ago (2012-02-03 19:30:42 UTC) #5
yzshen1
Hi, Mike. Sorry for the late reply. I didn't feel well last week and was ...
8 years, 10 months ago (2012-02-06 06:51:27 UTC) #6
mtilburg1
Fixed comments from Yuzhu- I should note, that this compiles and links, however after my ...
8 years, 10 months ago (2012-02-06 15:11:34 UTC) #7
yzshen1
Please also add some tests for the newly added method, if possible. Thanks! https://chromiumcodereview.appspot.com/9212047/diff/10001/ppapi/api/private/ppb_udp_socket_private.idl File ...
8 years, 10 months ago (2012-02-06 18:12:50 UTC) #8
mtilburg1
* Added ppapi version support to nacl * added unit test for GetBoundAddress * fixed ...
8 years, 10 months ago (2012-02-07 12:48:53 UTC) #9
yzshen1
Mostly look good. Thanks! https://chromiumcodereview.appspot.com/9212047/diff/24001/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc File ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc (right): https://chromiumcodereview.appspot.com/9212047/diff/24001/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc#newcode96 ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc:96: PluginUDPSocketPrivate::GetInterface_0_2(), true }, Please be ...
8 years, 10 months ago (2012-02-07 18:14:58 UTC) #10
mtilburg1
fixes from last review https://chromiumcodereview.appspot.com/9212047/diff/24001/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc File ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc (right): https://chromiumcodereview.appspot.com/9212047/diff/24001/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc#newcode96 ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc:96: PluginUDPSocketPrivate::GetInterface_0_2(), true }, On 2012/02/07 ...
8 years, 10 months ago (2012-02-07 22:08:14 UTC) #11
yzshen1
lgtm
8 years, 10 months ago (2012-02-07 22:13:40 UTC) #12
yzshen1
On 2012/02/07 22:13:40, yzshen1 wrote: > lgtm You also need owner approval before you can ...
8 years, 10 months ago (2012-02-07 22:18:53 UTC) #13
mtilburg1
Thanks Yuzhu! Do we need to have Trung look at this too... or is it ...
8 years, 10 months ago (2012-02-07 22:19:10 UTC) #14
yzshen1
On 2012/02/07 22:19:10, mtilburg1 wrote: > Thanks Yuzhu! > > Do we need to have ...
8 years, 10 months ago (2012-02-07 22:22:11 UTC) #15
mtilburg1
Adding Brett Wilson to reviewers, needed for OWNER approval...
8 years, 10 months ago (2012-02-07 22:38:45 UTC) #16
viettrungluu
Someone qualified should also take a look at the nacl bits. https://chromiumcodereview.appspot.com/9212047/diff/31003/content/browser/renderer_host/pepper_udp_socket.cc File content/browser/renderer_host/pepper_udp_socket.cc (right): ...
8 years, 10 months ago (2012-02-07 23:03:58 UTC) #17
mtilburg1
added a few more unit tests, changed SendBindACK to be more consistant with OnRecvFromCompleted/SendRecvFromACKError. changed ...
8 years, 10 months ago (2012-02-08 15:27:00 UTC) #18
dmichael (off chromium)
ppapi/* LGTM https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/c/private/ppb_udp_socket_private.h File ppapi/c/private/ppb_udp_socket_private.h (right): https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/c/private/ppb_udp_socket_private.h#newcode47 ppapi/c/private/ppb_udp_socket_private.h:47: * call to Bind must be called ...
8 years, 10 months ago (2012-02-08 16:05:20 UTC) #19
brettw
high level LGTM https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/api/private/ppb_udp_socket_private.idl File ppapi/api/private/ppb_udp_socket_private.idl (right): https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/api/private/ppb_udp_socket_private.idl#newcode32 ppapi/api/private/ppb_udp_socket_private.idl:32: * call to Bind must be ...
8 years, 10 months ago (2012-02-09 00:19:26 UTC) #20
mtilburg1
https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/api/private/ppb_udp_socket_private.idl File ppapi/api/private/ppb_udp_socket_private.idl (right): https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/api/private/ppb_udp_socket_private.idl#newcode32 ppapi/api/private/ppb_udp_socket_private.idl:32: * call to Bind must be called first. Returns ...
8 years, 10 months ago (2012-02-09 11:08:06 UTC) #21
dmichael (off chromium)
lgtm https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc File ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc (right): https://chromiumcodereview.appspot.com/9212047/diff/32011/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc#newcode108 ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_udp_socket_private_rpc_server.cc:108: reinterpret_cast<PP_NetAddress_Private*>(addr)); On 2012/02/09 11:08:06, mtilburg1 wrote: > On ...
8 years, 10 months ago (2012-02-09 16:31:10 UTC) #22
viettrungluu
http://codereview.chromium.org/9212047/diff/46001/content/browser/renderer_host/pepper_udp_socket.cc File content/browser/renderer_host/pepper_udp_socket.cc (right): http://codereview.chromium.org/9212047/diff/46001/content/browser/renderer_host/pepper_udp_socket.cc#newcode51 content/browser/renderer_host/pepper_udp_socket.cc:51: Probably you want to reset the socket in the ...
8 years, 10 months ago (2012-02-16 18:47:10 UTC) #23
mtilburg1
8 years, 10 months ago (2012-02-17 12:14:23 UTC) #24
http://codereview.chromium.org/9212047/diff/46001/content/browser/renderer_ho...
File content/browser/renderer_host/pepper_udp_socket.cc (right):

http://codereview.chromium.org/9212047/diff/46001/content/browser/renderer_ho...
content/browser/renderer_host/pepper_udp_socket.cc:51: 
On 2012/02/16 18:47:10, viettrungluu wrote:
> Probably you want to reset the socket in the failure cases.

Trung - I'm not sure this is necessary, since the bind has not succeeded, no
other operations will be allowed to occur.  The next time that Bind is called,
it will be reset.

http://codereview.chromium.org/9212047/diff/46001/content/browser/renderer_ho...
content/browser/renderer_host/pepper_udp_socket.cc:52: if (result == net::OK &&
On 2012/02/16 18:47:10, viettrungluu wrote:
> (See comment below. I guess you'll need to modify SendBindACK() to take a
> PP_NetAddress_Private.)
> 
> Do something like:
> 
> scoped_ptr<WHATEVER socket_ points to> socket;
> PP_NetAddress_Private bound_netaddr =
NetAddressPrivateImpl::kInvalidNetAddress;
> 
> ... replacing socket_ with socket ...
> 
> bool success =
>     result != net::OK ||
>     socket_->GetLockAddress(&bound_address_) != net::OK ||
>     NetAddressPrivateImpl::IPEndPointToNetAddress(bound_address_,
> bound_netaddr));
> if (success)
>   socket_.reset(socket.release());
> SendBindACK(success, bound_netaddr);
> 
> 
> Maybe you need to do something more in the case that IPEndPointToNetAddress()
> failed (but Listen() didn't). Or, more likely, that really shouldn't happen,
and
> you should just CHECK/DCHECK that it succeeded (in which case you can put it
in
> SendBindACK() again, and SendBindACK() need only take a bool).

Trung-

While this method will also work, I don't agree that this is any better than
what I have.  See my response to the comment below

http://codereview.chromium.org/9212047/diff/46001/content/browser/renderer_ho...
content/browser/renderer_host/pepper_udp_socket.cc:114: void
PepperUDPSocket::SendBindACKError() {
On 2012/02/16 18:47:10, viettrungluu wrote:
> This is now needlessly redundant and convoluted. I think you should stick with
> the old |SendBindACK()|, and do the additional |IPEndPointToNetAddress()| in
the
> body of |Bind()|.

I don't agree... we need an Error case (as we have for RecvFrom) because in the
error case we need to make sure that we don't send a garbage addr back(as you
pointed out in the last review)

Powered by Google App Engine
This is Rietveld 408576698