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

Issue 2714573002: Enable websocket filtering via SubresourceFilter (Closed)

Created:
3 years, 10 months ago by Charlie Harrison
Modified:
3 years, 9 months ago
Reviewers:
engedy, yhirano, pkalinnikov
CC:
chromium-reviews, tyoshino+watch_chromium.org, subresource-filter-reviews_chromium.org, yhirano+watch_chromium.org, blink-reviews, dglazkov+blink, haraken, blink-reviews-api_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable websocket filtering via SubresourceFilter This CL adds a hook into the DocumentWebSocketChannel to filter WebSocket connections via the DocumentLoader's SubresourceFilter. BUG=609747 Review-Url: https://codereview.chromium.org/2714573002 Cr-Commit-Position: refs/heads/master@{#455254} Committed: https://chromium.googlesource.com/chromium/src/+/e86d3f063e9d258dfc9d1a11a9c6a124fb9a6d9f

Patch Set 1 #

Patch Set 2 : actually add html/js files :P #

Total comments: 4

Patch Set 3 : yhirano review #

Patch Set 4 : rebase #

Patch Set 5 : notifyLoad #

Patch Set 6 : ugh #

Patch Set 7 : return true #

Total comments: 3

Patch Set 8 : implement failWithClosureCode #

Total comments: 4

Patch Set 9 : Enable websocket filtering via WebDocumentSubresourceFilter #

Total comments: 17

Patch Set 10 : respond to comments #

Patch Set 11 : rebase #

Total comments: 4

Patch Set 12 : OWNERS #

Total comments: 21

Patch Set 13 : git cl try #

Total comments: 9

Patch Set 14 : engedy review #

Total comments: 2

Patch Set 15 : git cl try #

Patch Set 16 : sync to #455176 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+249 lines, -37 lines) Patch
M chrome/browser/subresource_filter/OWNERS View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/subresource_filter/subresource_filter_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +94 lines, -2 lines 0 comments Download
A chrome/test/data/subresource_filter/page_with_websocket.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +31 lines, -0 lines 0 comments Download
A chrome/test/data/subresource_filter/websocket_connection.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/subresource_filter/websocket_worker.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M components/subresource_filter/core/common/document_subresource_filter_unittest.cc View 1 2 5 chunks +14 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/loader/SubresourceFilter.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/SubresourceFilter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +45 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +42 lines, -10 lines 0 comments Download

Messages

Total messages: 103 (63 generated)
Charlie Harrison
yhirano: Here is a draft of the websocket filtering CL. LMK what you think about ...
3 years, 10 months ago (2017-02-22 22:01:02 UTC) #4
yhirano
I imagined something like this: // in open: ... if (blocked by CSP) { throw; ...
3 years, 10 months ago (2017-02-24 03:55:30 UTC) #11
Charlie Harrison
Hey yhirano: couple notes: 1. We can't do this check during CSP checks because it ...
3 years, 10 months ago (2017-02-24 21:13:02 UTC) #16
yhirano
On 2017/02/24 21:13:02, Charlie Harrison wrote: > Hey yhirano: > couple notes: > 1. We ...
3 years, 9 months ago (2017-02-28 10:13:24 UTC) #27
Charlie Harrison
On 2017/02/28 10:13:24, yhirano (slow) wrote: > On 2017/02/24 21:13:02, Charlie Harrison wrote: > > ...
3 years, 9 months ago (2017-02-28 13:42:42 UTC) #28
yhirano
On 2017/02/28 13:42:42, Charlie Harrison wrote: > On 2017/02/28 10:13:24, yhirano (slow) wrote: > > ...
3 years, 9 months ago (2017-02-28 13:57:20 UTC) #29
Charlie Harrison
On 2017/02/28 13:57:20, yhirano (slow) wrote: > On 2017/02/28 13:42:42, Charlie Harrison wrote: > > ...
3 years, 9 months ago (2017-02-28 14:01:31 UTC) #30
Charlie Harrison
Thanks yhirano, this was a good solution. +engedy for subresource filter bits, but feel free ...
3 years, 9 months ago (2017-02-28 15:11:00 UTC) #34
yhirano
https://codereview.chromium.org/2714573002/diff/120001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/120001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode205 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:205: WTF::bind(&DocumentWebSocketChannel::handleDidClose, Thank you! I found we need some more ...
3 years, 9 months ago (2017-03-01 03:40:43 UTC) #37
Charlie Harrison
Thanks! https://codereview.chromium.org/2714573002/diff/120001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/120001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode205 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:205: WTF::bind(&DocumentWebSocketChannel::handleDidClose, On 2017/03/01 03:40:42, yhirano (slow) wrote: > ...
3 years, 9 months ago (2017-03-01 03:58:51 UTC) #38
yhirano
https://codereview.chromium.org/2714573002/diff/140001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/140001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode199 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:199: // If the connection needs to be filtered, asynchronously ...
3 years, 9 months ago (2017-03-01 06:40:58 UTC) #41
Charlie Harrison
https://codereview.chromium.org/2714573002/diff/140001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/140001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode199 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:199: // If the connection needs to be filtered, asynchronously ...
3 years, 9 months ago (2017-03-01 18:55:57 UTC) #44
yhirano
Thank you! modules/websockets lgtm. Please update the issue title (it's now DocumentSubresourceFilter). Providing a more ...
3 years, 9 months ago (2017-03-02 03:32:49 UTC) #49
Charlie Harrison
Many thanks for the detailed review, yhirano. engedy: PTAL at the SubresourceFilter code. In particular, ...
3 years, 9 months ago (2017-03-02 03:44:35 UTC) #51
engedy
Thanks a lot and sorry for the slow response. > engedy: PTAL at the SubresourceFilter ...
3 years, 9 months ago (2017-03-02 09:38:36 UTC) #53
pkalinnikov
Some comments regarding the SubresourceFilter part. https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js File chrome/test/data/subresource_filter/websocket_connection.js (right): https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js#newcode12 chrome/test/data/subresource_filter/websocket_connection.js:12: ws.addEventListener('open', function() { ...
3 years, 9 months ago (2017-03-02 12:33:54 UTC) #54
Charlie Harrison
Thanks Pavel! https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js File chrome/test/data/subresource_filter/websocket_connection.js (right): https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js#newcode12 chrome/test/data/subresource_filter/websocket_connection.js:12: ws.addEventListener('open', function() { On 2017/03/02 12:33:53, pkalinnikov ...
3 years, 9 months ago (2017-03-02 14:48:01 UTC) #55
pkalinnikov
LGTM, thanks! yhirano@: In case you missed, I had a question for you in https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js
3 years, 9 months ago (2017-03-02 17:04:10 UTC) #56
yhirano
https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js File chrome/test/data/subresource_filter/websocket_connection.js (right): https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js#newcode12 chrome/test/data/subresource_filter/websocket_connection.js:12: ws.addEventListener('open', function() { On 2017/03/02 14:48:00, Charlie Harrison wrote: ...
3 years, 9 months ago (2017-03-03 06:15:22 UTC) #61
pkalinnikov
Still LGTM + last-minute nits. https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js File chrome/test/data/subresource_filter/websocket_connection.js (right): https://codereview.chromium.org/2714573002/diff/160001/chrome/test/data/subresource_filter/websocket_connection.js#newcode12 chrome/test/data/subresource_filter/websocket_connection.js:12: ws.addEventListener('open', function() { On ...
3 years, 9 months ago (2017-03-03 10:19:06 UTC) #62
Charlie Harrison
engedy: WDYT about syncing these OWNERS files? I noticed Pavel is not an owner in ...
3 years, 9 months ago (2017-03-03 13:59:26 UTC) #63
engedy
https://codereview.chromium.org/2714573002/diff/220001/chrome/browser/subresource_filter/OWNERS File chrome/browser/subresource_filter/OWNERS (right): https://codereview.chromium.org/2714573002/diff/220001/chrome/browser/subresource_filter/OWNERS#newcode1 chrome/browser/subresource_filter/OWNERS:1: file://components/subresource_filter/OWNERS Thanks for fixing this! https://codereview.chromium.org/2714573002/diff/220001/chrome/browser/subresource_filter/subresource_filter_browsertest.cc File chrome/browser/subresource_filter/subresource_filter_browsertest.cc (right): ...
3 years, 9 months ago (2017-03-06 14:12:46 UTC) #68
Charlie Harrison
Thanks! yhirano: FYI there is a question for you about the failure status codes. We've ...
3 years, 9 months ago (2017-03-06 14:48:23 UTC) #69
engedy
LGTM % final set of comments. https://codereview.chromium.org/2714573002/diff/220001/chrome/browser/subresource_filter/subresource_filter_browsertest.cc File chrome/browser/subresource_filter/subresource_filter_browsertest.cc (right): https://codereview.chromium.org/2714573002/diff/220001/chrome/browser/subresource_filter/subresource_filter_browsertest.cc#newcode261 chrome/browser/subresource_filter/subresource_filter_browsertest.cc:261: GURL GetTestUrl(const std::string& ...
3 years, 9 months ago (2017-03-06 16:31:02 UTC) #70
engedy
https://codereview.chromium.org/2714573002/diff/240001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/240001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode199 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:199: String("Connection disallowed by the subresource filter"), On 2017/03/06 16:31:01, ...
3 years, 9 months ago (2017-03-06 17:46:13 UTC) #71
Charlie Harrison
OK I've removed all logging and responded to your concerns. yhirano: Please take another pass ...
3 years, 9 months ago (2017-03-06 19:22:12 UTC) #74
yhirano
lgtm https://codereview.chromium.org/2714573002/diff/260001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/260001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode699 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:699: // |reason| is only for logging and should ...
3 years, 9 months ago (2017-03-06 20:39:01 UTC) #75
Charlie Harrison
Thank you! https://codereview.chromium.org/2714573002/diff/260001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp File third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp (right): https://codereview.chromium.org/2714573002/diff/260001/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp#newcode699 third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp:699: // |reason| is only for logging and ...
3 years, 9 months ago (2017-03-06 20:48:21 UTC) #76
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714573002/280001
3 years, 9 months ago (2017-03-06 20:51:26 UTC) #79
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/394962)
3 years, 9 months ago (2017-03-06 23:30:20 UTC) #81
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714573002/280001
3 years, 9 months ago (2017-03-07 00:00:05 UTC) #83
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/395399)
3 years, 9 months ago (2017-03-07 04:46:32 UTC) #85
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714573002/280001
3 years, 9 months ago (2017-03-07 04:49:12 UTC) #87
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/395534)
3 years, 9 months ago (2017-03-07 08:27:00 UTC) #89
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714573002/280001
3 years, 9 months ago (2017-03-07 10:26:50 UTC) #91
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/395801)
3 years, 9 months ago (2017-03-07 14:19:38 UTC) #93
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714573002/280001
3 years, 9 months ago (2017-03-07 14:22:14 UTC) #95
commit-bot: I haz the power
Failed to apply patch for third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp: While running git apply --index -p1; error: patch failed: ...
3 years, 9 months ago (2017-03-07 16:14:54 UTC) #97
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2714573002/300001
3 years, 9 months ago (2017-03-07 19:55:19 UTC) #100
commit-bot: I haz the power
3 years, 9 months ago (2017-03-07 22:28:31 UTC) #103
Message was sent while issue was closed.
Committed patchset #16 (id:300001) as
https://chromium.googlesource.com/chromium/src/+/e86d3f063e9d258dfc9d1a11a9c6...

Powered by Google App Engine
This is Rietveld 408576698