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

Issue 965613002: Open a firewall hole when a TCP server or UDP socket is bound. (Closed)

Created:
5 years, 9 months ago by Reilly Grant (use Gerrit)
Modified:
5 years, 9 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, oshima+watch_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Open a firewall hole when a TCP server or UDP socket is bound. This patch implements firewall hole punching when a Chrome App uses the chrome.socket, chrome.sockets.tcpServer or chrome.sockets.udp APIs to open a socket to receive packets from the network. Sockets that only listen on the local loopback device do not open a port. A primitive FirewallHole class is added that could be reused by the Pepper sockets API as well. BUG=435404 Committed: https://crrev.com/bed8fdc7a0995427e0af24e63693ad790920b612 Cr-Commit-Position: refs/heads/master@{#320552}

Patch Set 1 #

Patch Set 2 : Actually use the thread_checker_ in FirewallHole. #

Total comments: 34

Patch Set 3 : Rewrite FirewallHole to avoid |delete this|. #

Patch Set 4 : Call AsyncWorkCompleted() after firewall hole opened. #

Patch Set 5 : Address the rest of pneubeck@'s comments. #

Total comments: 6

Patch Set 6 : Add firewall_hole_unittest.cc. #

Total comments: 12

Patch Set 7 : Final cleanups. #

Patch Set 8 : Explicitly include "base/logging.h" where needed. #

Patch Set 9 : Put this feature behind a flag. #

Patch Set 10 : Add flag to histograms.xml. #

Patch Set 11 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+594 lines, -53 lines) Patch
M chrome/app/chromeos_strings.grdp View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -0 lines 0 comments Download
M chromeos/chromeos.gyp View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M chromeos/chromeos_switches.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chromeos/chromeos_switches.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M chromeos/dbus/fake_permission_broker_client.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -4 lines 0 comments Download
A chromeos/network/firewall_hole.h View 1 2 3 4 1 chunk +80 lines, -0 lines 0 comments Download
A chromeos/network/firewall_hole.cc View 1 2 3 4 5 6 1 chunk +164 lines, -0 lines 0 comments Download
A chromeos/network/firewall_hole_unittest.cc View 1 2 3 4 5 6 1 chunk +135 lines, -0 lines 0 comments Download
M extensions/browser/api/socket/socket.h View 3 chunks +16 lines, -0 lines 0 comments Download
M extensions/browser/api/socket/socket_api.h View 4 chunks +18 lines, -2 lines 0 comments Download
M extensions/browser/api/socket/socket_api.cc View 1 2 3 4 5 6 7 8 5 chunks +130 lines, -35 lines 0 comments Download
M extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc View 3 chunks +9 lines, -6 lines 0 comments Download
M extensions/browser/api/sockets_udp/sockets_udp_api.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/api/sockets_udp/sockets_udp_api.cc View 2 chunks +9 lines, -4 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 37 (8 generated)
Reilly Grant (use Gerrit)
gauravsh@, please take a look at the new class in //chromeos/network. finnur@, please take a ...
5 years, 9 months ago (2015-02-27 00:10:44 UTC) #2
Finnur
https://codereview.chromium.org/965613002/diff/20001/extensions/browser/api/socket/socket_api.h File extensions/browser/api/socket/socket_api.h (right): https://codereview.chromium.org/965613002/diff/20001/extensions/browser/api/socket/socket_api.h#newcode125 extensions/browser/api/socket/socket_api.h:125: // Only implemented on Chrome OS. Is this intended ...
5 years, 9 months ago (2015-02-27 11:23:52 UTC) #3
Reilly Grant (use Gerrit)
https://codereview.chromium.org/965613002/diff/20001/extensions/browser/api/socket/socket_api.h File extensions/browser/api/socket/socket_api.h (right): https://codereview.chromium.org/965613002/diff/20001/extensions/browser/api/socket/socket_api.h#newcode125 extensions/browser/api/socket/socket_api.h:125: // Only implemented on Chrome OS. On 2015/02/27 11:23:52, ...
5 years, 9 months ago (2015-02-27 15:57:24 UTC) #4
Finnur
In that case, LGTM
5 years, 9 months ago (2015-02-27 15:58:49 UTC) #5
Reilly Grant (use Gerrit)
CCing jorgelo@ FYI.
5 years, 9 months ago (2015-02-27 18:17:29 UTC) #6
Jorge Lucangeli Obes
On 2015/02/27 15:57:24, reillyg wrote: > https://codereview.chromium.org/965613002/diff/20001/extensions/browser/api/socket/socket_api.h > File extensions/browser/api/socket/socket_api.h (right): > > https://codereview.chromium.org/965613002/diff/20001/extensions/browser/api/socket/socket_api.h#newcode125 > ...
5 years, 9 months ago (2015-02-27 19:35:50 UTC) #7
Reilly Grant (use Gerrit)
pneubeck@, please take a look at the new class in //chromeos/network.
5 years, 9 months ago (2015-03-02 18:58:24 UTC) #9
rpaquay
lgtm
5 years, 9 months ago (2015-03-02 19:23:51 UTC) #10
Reilly Grant (use Gerrit)
armansito@, please take a look at the new class in //chromeos/network.
5 years, 9 months ago (2015-03-03 20:26:04 UTC) #12
pneubeck (no reviews)
https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc File chromeos/network/firewall_hole.cc (right): https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc#newcode41 chromeos/network/firewall_hole.cc:41: const char* port_type; please explicitly initialize to null, or ...
5 years, 9 months ago (2015-03-03 22:24:52 UTC) #14
Reilly Grant (use Gerrit)
I've rewritten FirewallHole to avoid the use of |delete this|. https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc File chromeos/network/firewall_hole.cc (right): https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc#newcode41 ...
5 years, 9 months ago (2015-03-04 01:35:50 UTC) #15
Reilly Grant (use Gerrit)
Ping?
5 years, 9 months ago (2015-03-06 18:33:58 UTC) #16
armansito
On 2015/03/06 18:33:58, reillyg wrote: > Ping? I leave it up to pneubeck@ since he ...
5 years, 9 months ago (2015-03-06 22:44:20 UTC) #17
pneubeck (no reviews)
Please reply to my other comments whether you addressed them or why you think otherwise.
5 years, 9 months ago (2015-03-07 02:02:37 UTC) #18
Reilly Grant (use Gerrit)
Sorry, I lost track of your comments on firewall_hole.h. This should resolve them. https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc File ...
5 years, 9 months ago (2015-03-07 02:36:03 UTC) #19
pneubeck (no reviews)
https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc File chromeos/network/firewall_hole.cc (right): https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.cc#newcode124 chromeos/network/firewall_hole.cc:124: DBusThreadManager::Get()->GetPermissionBrokerClient(); On 2015/03/04 01:35:50, reillyg wrote: > On 2015/03/03 ...
5 years, 9 months ago (2015-03-08 03:35:01 UTC) #20
Reilly Grant (use Gerrit)
On 2015/03/08 03:35:01, pneubeck wrote: > https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.h > File chromeos/network/firewall_hole.h (right): > > https://codereview.chromium.org/965613002/diff/20001/chromeos/network/firewall_hole.h#newcode32 > ...
5 years, 9 months ago (2015-03-09 19:56:37 UTC) #21
Reilly Grant (use Gerrit)
https://codereview.chromium.org/965613002/diff/80001/chromeos/network/firewall_hole.cc File chromeos/network/firewall_hole.cc (right): https://codereview.chromium.org/965613002/diff/80001/chromeos/network/firewall_hole.cc#newcode46 chromeos/network/firewall_hole.cc:46: default: On 2015/03/08 03:35:01, pneubeck wrote: > could you ...
5 years, 9 months ago (2015-03-09 19:57:06 UTC) #22
pneubeck (no reviews)
https://codereview.chromium.org/965613002/diff/80001/chromeos/network/firewall_hole.cc File chromeos/network/firewall_hole.cc (right): https://codereview.chromium.org/965613002/diff/80001/chromeos/network/firewall_hole.cc#newcode99 chromeos/network/firewall_hole.cc:99: PermissionBrokerClient* client = On 2015/03/09 19:57:06, reillyg wrote: > ...
5 years, 9 months ago (2015-03-09 20:03:47 UTC) #23
Reilly Grant (use Gerrit)
I've added unit tests that use a MockPermissionBrokerClient to exercise the success and failure cases. ...
5 years, 9 months ago (2015-03-09 23:32:47 UTC) #24
pneubeck (no reviews)
chromeos/ lgtm with a few nits https://codereview.chromium.org/965613002/diff/100001/chromeos/network/firewall_hole.cc File chromeos/network/firewall_hole.cc (right): https://codereview.chromium.org/965613002/diff/100001/chromeos/network/firewall_hole.cc#newcode110 chromeos/network/firewall_hole.cc:110: NOTREACHED(); this is ...
5 years, 9 months ago (2015-03-10 08:49:22 UTC) #25
Reilly Grant (use Gerrit)
Adding stevenjb@ as I have modified chromeos/dbus/fake_permission_broker_client.cc so that requests succeed, allowing me to avoid ...
5 years, 9 months ago (2015-03-10 20:15:17 UTC) #27
Reilly Grant (use Gerrit)
Add jwd@ because I've added the flag to histograms.xml.
5 years, 9 months ago (2015-03-11 20:52:42 UTC) #29
jwd
lgtm
5 years, 9 months ago (2015-03-12 17:12:20 UTC) #30
Reilly Grant (use Gerrit)
stevenjb@, ping?
5 years, 9 months ago (2015-03-13 18:13:25 UTC) #31
stevenjb
chromeos/ owner rubber stamp lgtm
5 years, 9 months ago (2015-03-13 19:02:31 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/965613002/200001
5 years, 9 months ago (2015-03-13 19:31:56 UTC) #35
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 9 months ago (2015-03-13 19:42:04 UTC) #36
commit-bot: I haz the power
5 years, 9 months ago (2015-03-13 19:43:49 UTC) #37
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/bed8fdc7a0995427e0af24e63693ad790920b612
Cr-Commit-Position: refs/heads/master@{#320552}

Powered by Google App Engine
This is Rietveld 408576698