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

Issue 12684008: Multicast socket API (Closed)

Created:
7 years, 9 months ago by Bei Zhang
Modified:
7 years, 7 months ago
Reviewers:
jam, wtc, piman, miket_OOO, scheib, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, chromium-apps-reviews_chromium.org
Visibility:
Public.

Description

Introduce Multicast Socket API Allow Chrome Apps developer to receive multicast socket packets by exposing join/leave group ability to UDP socket. Introducing: 1. chrome.socket.joinGroup / chrome.socket.leaveGroup / chrome.socket.getJoinedGroups to manipulate multicast group membership. 2. Socket permission 'udp-multicast-membership'. 3. chrome.socket.setMulticastTimeToLive / chrome.socket.setMulticastLoopbackMode to control the multicast packet sending for UDP sender. To expose the ability of manipulating multicast group membership and controlling multicast packet sending, new methods are added into network stack (net::UDPSocket class): 1. JoinGroup/LeaveGroup 2. SetMulticastTimeToLive/SetMulticastLoopbackMode To demo the ability, a demo app is created: https://github.com/GoogleChrome/chrome-app-samples/pull/92 TEST=Open the demo app at /chrome-app-samples/multicast in two machines of the same network. Open them and chat, they can talk to each other. NOTRY=true BUG=140681 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197192

Patch Set 1 : Muticast socket API #

Patch Set 2 : Rebase lkgr #

Total comments: 21

Patch Set 3 : Update documents #

Patch Set 4 : Minor fixes #

Patch Set 5 : Fix tests #

Total comments: 73

Patch Set 6 : Fix code style #

Total comments: 52

Patch Set 7 : Fix as per wtc and mmenke #

Patch Set 8 : Fix windows build #

Total comments: 19

Patch Set 9 : Fix builds #

Patch Set 10 : Disable multicast test on android #

Total comments: 26

Patch Set 11 : Fix tests #

Total comments: 13

Patch Set 12 : Changing DCHECKs to returning error code. #

Total comments: 8

Patch Set 13 : Minor fixes #

Total comments: 51

Patch Set 14 : Fixes #

Total comments: 4

Patch Set 15 : Changing extensions::UDPSocket::multicast_groups_ to a vector #

Patch Set 16 : Merge to master/origin #

Patch Set 17 : Add License info to multicast.js #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1210 lines, -37 lines) Patch
M chrome/browser/extensions/api/socket/socket_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +87 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +211 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_apitest.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +52 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +96 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/socket.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +77 lines, -0 lines 0 comments Download
M chrome/common/extensions/permissions/socket_permission_data.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/common/extensions/permissions/socket_permission_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +12 lines, -0 lines 0 comments Download
M chrome/common/extensions/permissions/socket_permission_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/socket/api/background.js View 1 2 3 4 5 6 2 chunks +17 lines, -17 lines 0 comments Download
M chrome/test/data/extensions/api_test/socket/api/manifest.json View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/api_test/socket/api/multicast.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +198 lines, -0 lines 0 comments Download
M content/public/common/socket_permission_request.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M net/udp/udp_socket_libevent.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +46 lines, -2 lines 0 comments Download
M net/udp/udp_socket_libevent.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +132 lines, -5 lines 0 comments Download
M net/udp/udp_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +54 lines, -0 lines 0 comments Download
M net/udp/udp_socket_win.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +44 lines, -2 lines 0 comments Download
M net/udp/udp_socket_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +130 lines, -4 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
Bei Zhang
Hi Vince, Please review. Thanks, Bei
7 years, 9 months ago (2013-03-26 00:47:48 UTC) #1
Bei Zhang
Hi Mike, Please review. Thanks, Bei
7 years, 9 months ago (2013-03-27 19:58:15 UTC) #2
scheib
Initial review - though I'm quite unfamiliar with multicast, so expect and seek out more ...
7 years, 8 months ago (2013-04-02 18:25:17 UTC) #3
Bei Zhang
https://codereview.chromium.org/12684008/diff/29009/chrome/common/extensions/api/socket.idl File chrome/common/extensions/api/socket.idl (right): https://codereview.chromium.org/12684008/diff/29009/chrome/common/extensions/api/socket.idl#newcode117 chrome/common/extensions/api/socket.idl:117: callback JoinGroupCallback = void (long result); I checked other ...
7 years, 8 months ago (2013-04-05 00:38:59 UTC) #4
scheib
https://codereview.chromium.org/12684008/diff/29009/chrome/common/extensions/api/socket.idl File chrome/common/extensions/api/socket.idl (right): https://codereview.chromium.org/12684008/diff/29009/chrome/common/extensions/api/socket.idl#newcode117 chrome/common/extensions/api/socket.idl:117: callback JoinGroupCallback = void (long result); On 2013/04/05 00:38:59, ...
7 years, 8 months ago (2013-04-05 17:41:03 UTC) #5
Bei Zhang
Hi Vince, I've edited the test cases according to the comments of jar and network ...
7 years, 8 months ago (2013-04-11 23:16:38 UTC) #6
scheib
lgtm on the topics I raised earlier. Again, I'm don't have enough networking domain knowledge ...
7 years, 8 months ago (2013-04-12 00:04:34 UTC) #7
Bei Zhang
Hi owners, please review: miket: chrome/browser/extensions/api/socket/socket_api.cc chrome/browser/extensions/api/socket/socket_api.h chrome/browser/extensions/api/socket/socket_apitest.cc chrome/browser/extensions/api/socket/udp_socket.cc chrome/browser/extensions/api/socket/udp_socket.h chrome/browser/extensions/api/socket/udp_socket_unittest.cc chrome/browser/extensions/extension_function_histogram_value.h chrome/common/extensions/api/socket.idl chrome/common/extensions/permissions/socket_permission_data.cc chrome/common/extensions/permissions/socket_permission_data.h ...
7 years, 8 months ago (2013-04-12 20:21:18 UTC) #8
piman
LGTM, but adding jam for final vetting of public API
7 years, 8 months ago (2013-04-12 20:47:05 UTC) #9
jam
On 2013/04/12 20:47:05, piman wrote: > LGTM, but adding jam for final vetting of public ...
7 years, 8 months ago (2013-04-12 20:52:54 UTC) #10
mmenke
Bunch of style nits (No actual review of code yet). https://codereview.chromium.org/12684008/diff/80001/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): https://codereview.chromium.org/12684008/diff/80001/chrome/browser/extensions/api/socket/socket_api.cc#newcode689 ...
7 years, 8 months ago (2013-04-12 21:07:41 UTC) #11
Bei Zhang
Thanks for review! Also, I added two forgotten unit tests for net/udp for the new ...
7 years, 8 months ago (2013-04-15 22:30:26 UTC) #12
mmenke
While this looks reasonable to me, I feel that I'm not sufficiently familiar with the ...
7 years, 8 months ago (2013-04-16 18:09:49 UTC) #13
wtc
Review comments on patch set 6: Thank you for writing the CL. I only reviewed ...
7 years, 8 months ago (2013-04-16 19:59:42 UTC) #14
Bei Zhang
https://codereview.chromium.org/12684008/diff/111001/net/udp/udp_socket_libevent.cc File net/udp/udp_socket_libevent.cc (right): https://codereview.chromium.org/12684008/diff/111001/net/udp/udp_socket_libevent.cc#newcode485 net/udp/udp_socket_libevent.cc:485: sizeof(true_value)); On 2013/04/16 18:09:49, mmenke wrote: > This needs ...
7 years, 8 months ago (2013-04-17 17:53:03 UTC) #15
wtc
Patch set 8 LGTM. 1. I'm giving you LGTM in advance to save time. This ...
7 years, 8 months ago (2013-04-17 22:06:49 UTC) #16
Bei Zhang
Thanks for reviewing! Please note I disabled join group test for android because most android ...
7 years, 8 months ago (2013-04-19 19:40:13 UTC) #17
wtc
Patch set 10 LGTM. Thanks. Most of the changes I suggest are about style nits. ...
7 years, 8 months ago (2013-04-22 19:19:52 UTC) #18
Bei Zhang
Thanks for the review! About the MessageQueue issue, I'm so sorry to find out it ...
7 years, 8 months ago (2013-04-23 17:26:52 UTC) #19
wtc
Patch set 11 LGTM. https://codereview.chromium.org/12684008/diff/122028/chrome/browser/extensions/api/socket/udp_socket.cc File chrome/browser/extensions/api/socket/udp_socket.cc (right): https://codereview.chromium.org/12684008/diff/122028/chrome/browser/extensions/api/socket/udp_socket.cc#newcode265 chrome/browser/extensions/api/socket/udp_socket.cc:265: return net::ERR_FAILED; On 2013/04/23 17:26:53, ...
7 years, 8 months ago (2013-04-23 18:01:07 UTC) #20
Bei Zhang
https://codereview.chromium.org/12684008/diff/104004/chrome/browser/extensions/api/socket/udp_socket_unittest.cc File chrome/browser/extensions/api/socket/udp_socket_unittest.cc (right): https://codereview.chromium.org/12684008/diff/104004/chrome/browser/extensions/api/socket/udp_socket_unittest.cc#newcode87 chrome/browser/extensions/api/socket/udp_socket_unittest.cc:87: static void SendMulticastPacket(UDPSocket* src, On 2013/04/23 18:01:07, wtc wrote: ...
7 years, 8 months ago (2013-04-23 20:36:39 UTC) #21
wtc
Patch set 12 LGTM. Thanks. https://codereview.chromium.org/12684008/diff/104004/chrome/browser/extensions/api/socket/udp_socket_unittest.cc File chrome/browser/extensions/api/socket/udp_socket_unittest.cc (right): https://codereview.chromium.org/12684008/diff/104004/chrome/browser/extensions/api/socket/udp_socket_unittest.cc#newcode102 chrome/browser/extensions/api/socket/udp_socket_unittest.cc:102: static void OnMulticastReadCompleted(bool *packet_received, ...
7 years, 8 months ago (2013-04-23 22:15:26 UTC) #22
Bei Zhang
https://codereview.chromium.org/12684008/diff/185001/chrome/browser/extensions/api/socket/udp_socket_unittest.cc File chrome/browser/extensions/api/socket/udp_socket_unittest.cc (right): https://codereview.chromium.org/12684008/diff/185001/chrome/browser/extensions/api/socket/udp_socket_unittest.cc#newcode88 chrome/browser/extensions/api/socket/udp_socket_unittest.cc:88: // Send multicast packet every second. On 2013/04/23 22:15:26, ...
7 years, 8 months ago (2013-04-24 16:50:50 UTC) #23
wtc
Patch set 13 LGTM.
7 years, 8 months ago (2013-04-25 00:20:28 UTC) #24
miket_OOO
https://chromiumcodereview.appspot.com/12684008/diff/108002/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): https://chromiumcodereview.appspot.com/12684008/diff/108002/chrome/browser/extensions/api/socket/socket_api.cc#newcode46 chrome/browser/extensions/api/socket/socket_api.cc:46: const char kWildcardArress[] = "*"; I think this word ...
7 years, 8 months ago (2013-04-25 21:52:11 UTC) #25
Bei Zhang
Thanks for the review! https://codereview.chromium.org/12684008/diff/108002/chrome/browser/extensions/api/socket/socket_api.cc File chrome/browser/extensions/api/socket/socket_api.cc (right): https://codereview.chromium.org/12684008/diff/108002/chrome/browser/extensions/api/socket/socket_api.cc#newcode46 chrome/browser/extensions/api/socket/socket_api.cc:46: const char kWildcardArress[] = "*"; ...
7 years, 8 months ago (2013-04-25 23:56:21 UTC) #26
miket_OOO
LGTM but please see comments below. > That'll be ideal. But I think maybe we ...
7 years, 8 months ago (2013-04-26 01:20:01 UTC) #27
Bei Zhang
Thanks for the review! https://codereview.chromium.org/12684008/diff/222003/chrome/browser/extensions/api/socket/udp_socket.cc File chrome/browser/extensions/api/socket/udp_socket.cc (right): https://codereview.chromium.org/12684008/diff/222003/chrome/browser/extensions/api/socket/udp_socket.cc#newcode255 chrome/browser/extensions/api/socket/udp_socket.cc:255: multicast_groups_.erase(find_result); We are changing to ...
7 years, 8 months ago (2013-04-26 08:07:33 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ikarienator@chromium.org/12684008/238001
7 years, 7 months ago (2013-04-29 17:10:09 UTC) #29
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=182
7 years, 7 months ago (2013-04-29 17:15:39 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ikarienator@chromium.org/12684008/240003
7 years, 7 months ago (2013-04-29 17:24:56 UTC) #31
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=140922
7 years, 7 months ago (2013-04-29 21:00:31 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ikarienator@chromium.org/12684008/240003
7 years, 7 months ago (2013-04-29 23:38:14 UTC) #33
commit-bot: I haz the power
7 years, 7 months ago (2013-04-30 00:53:20 UTC) #34
Message was sent while issue was closed.
Change committed as 197192

Powered by Google App Engine
This is Rietveld 408576698