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

Issue 2952583002: SafeBrowsing support for WebSocket (post-network-servicification) (Closed)

Created:
3 years, 6 months ago by Adam Rice
Modified:
3 years, 5 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, vakh+watch_chromium.org, droger+watchlist_chromium.org, grt+watch_chromium.org, sdefresne+watchlist_chromium.org, timvolodine, blink-reviews-api_chromium.org, dglazkov+blink, darin-cc_chromium.org, blundell+watchlist_chromium.org, blink-reviews, android-webview-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

SafeBrowsing support for WebSocket (post-network-servicification) Add WebsocketSBHandshakeThrottle, an implementation of blink::WebSocketHandshakeThrottle that performs safe browsing checks. WebSocket handshakes are performed in parallel with the SafeBrowsing check. The result of the handshake will not be exposed to Javascript before the SafeBrowsing check passes. While an interstitial is displayed the WebSocket connection will remain in this pending state. If the connection is blocked then the WebSocket connection will be closed. Javascript will be notified of a connection error (without a specific reason) and the fact that the connection was blocked by SafeBrowsing will be logged to the console. This implementation requires the network service to be enabled. This means passing the --enable-network-service flag to chrome and browser_tests. The unit tests (which are compiled into the unit_tests binary) do not require the flag. See the design doc at https://docs.google.com/document/d/1iR3XMIQukqlXb6ajIHE91apHZAxyF_wvRoB5JGeJYPs/edit#heading=h.1r0zq3g29n7m BUG=644744 Review-Url: https://codereview.chromium.org/2952583002 Cr-Commit-Position: refs/heads/master@{#482897} Committed: https://chromium.googlesource.com/chromium/src/+/4ce57e66544e783efe1ae05548c2e00e0fd0ebed

Patch Set 1 #

Patch Set 2 : Fix compile error and a couple of nits #

Patch Set 3 : Fix compile on Windows #

Total comments: 10

Patch Set 4 : Share SafeBrowsing interface pointer, and misc fixes #

Total comments: 8

Patch Set 5 : Remove no-op std::move #

Patch Set 6 : Add V4SafeBrowsingServiceTest browser tests #

Patch Set 7 : Revert change to WebSocketHandshakeThrottle.h #

Total comments: 2

Patch Set 8 : Early-exit from tests if network service disabled #

Patch Set 9 : Move check of flag into *ContentRendererClient #

Patch Set 10 : Fix header files for move of service lookup #

Total comments: 4

Patch Set 11 : Remove useless DCHECKs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+498 lines, -7 lines) Patch
M android_webview/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/renderer/DEPS View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/renderer/aw_content_renderer_client.h View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -0 lines 0 comments Download
M android_webview/renderer/aw_content_renderer_client.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +24 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 2 3 4 5 6 7 4 chunks +119 lines, -0 lines 0 comments Download
M chrome/renderer/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +22 lines, -6 lines 0 comments Download
M chrome/test/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/safe_browsing/malware_websocket.html View 1 chunk +12 lines, -0 lines 0 comments Download
M components/safe_browsing/renderer/BUILD.gn View 1 chunk +36 lines, -0 lines 0 comments Download
M components/safe_browsing/renderer/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A components/safe_browsing/renderer/websocket_sb_handshake_throttle.h View 1 2 3 4 5 6 7 8 1 chunk +47 lines, -0 lines 0 comments Download
A components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc View 1 2 3 4 5 6 7 8 9 1 chunk +59 lines, -0 lines 0 comments Download
A components/safe_browsing/renderer/websocket_sb_handshake_throttle_unittest.cc View 1 2 3 1 chunk +135 lines, -0 lines 0 comments Download
M content/public/renderer/content_renderer_client.h View 1 2 chunks +7 lines, -1 line 0 comments Download
M content/public/renderer/content_renderer_client.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 71 (39 generated)
Adam Rice
+yhirano for WebSockets +yzshen for mojo SafeBrowsing
3 years, 6 months ago (2017-06-20 15:12:44 UTC) #12
yzshen1
+Varun for SafeBrowsing-related change. Mostly looks good, just a few nits. https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc File components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc (right): ...
3 years, 6 months ago (2017-06-20 19:52:19 UTC) #16
vakh (use Gerrit instead)
lgtm for components/safe_browsing/... https://codereview.chromium.org/2952583002/diff/40001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc File chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc (right): https://codereview.chromium.org/2952583002/diff/40001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc#newcode1481 chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc:1481: IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, MalwareWebSocketBlocked) { Please add the ...
3 years, 6 months ago (2017-06-20 21:40:28 UTC) #17
Adam Rice
https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc File components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc (right): https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc#newcode37 components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc:37: content::RenderThread::Get()->GetConnector()->BindInterface( On 2017/06/20 19:52:19, yzshen1 wrote: > You could ...
3 years, 6 months ago (2017-06-21 06:08:36 UTC) #20
kinuko
https://codereview.chromium.org/2952583002/diff/60001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc File components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc (right): https://codereview.chromium.org/2952583002/diff/60001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc#newcode48 components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc:48: safe_browsing_(std::move(safe_browsing)), nit: this std::move seems no-op https://codereview.chromium.org/2952583002/diff/60001/third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h File third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h ...
3 years, 6 months ago (2017-06-21 06:42:42 UTC) #22
Adam Rice
https://codereview.chromium.org/2952583002/diff/60001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc File components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc (right): https://codereview.chromium.org/2952583002/diff/60001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc#newcode48 components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc:48: safe_browsing_(std::move(safe_browsing)), On 2017/06/21 06:42:41, kinuko wrote: > nit: this ...
3 years, 6 months ago (2017-06-21 07:43:20 UTC) #23
kinuko
https://codereview.chromium.org/2952583002/diff/60001/third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h File third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h (left): https://codereview.chromium.org/2952583002/diff/60001/third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h#oldcode18 third_party/WebKit/public/platform/WebSocketHandshakeThrottle.h:18: #include "public/platform/WebCallbacks.h" On 2017/06/21 07:43:20, Adam Rice wrote: > ...
3 years, 6 months ago (2017-06-21 08:59:35 UTC) #24
Adam Rice
https://codereview.chromium.org/2952583002/diff/40001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc File chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc (right): https://codereview.chromium.org/2952583002/diff/40001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc#newcode1481 chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc:1481: IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, MalwareWebSocketBlocked) { On 2017/06/20 21:40:27, vakh (use Gerrit ...
3 years, 6 months ago (2017-06-21 09:18:47 UTC) #26
yhirano
lgtm https://codereview.chromium.org/2952583002/diff/60001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc File chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc (right): https://codereview.chromium.org/2952583002/diff/60001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc#newcode1483 chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc:1483: if (base::CommandLine::ForCurrentProcess()->HasSwitch( I prefer if (!HasSwitch()) return;
3 years, 6 months ago (2017-06-21 09:38:38 UTC) #28
kinuko
> I see. It must have got better when I fixed the DEPS file. I've ...
3 years, 6 months ago (2017-06-21 13:19:24 UTC) #31
yzshen1
https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc File components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc (right): https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc#newcode37 components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc:37: content::RenderThread::Get()->GetConnector()->BindInterface( On 2017/06/21 06:08:35, Adam Rice wrote: > On ...
3 years, 6 months ago (2017-06-21 16:55:06 UTC) #32
Adam Rice
https://codereview.chromium.org/2952583002/diff/120001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc File chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc (right): https://codereview.chromium.org/2952583002/diff/120001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc#newcode2253 chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc:2253: // when the old database backend stops being used. ...
3 years, 6 months ago (2017-06-22 12:29:31 UTC) #33
Adam Rice
https://codereview.chromium.org/2952583002/diff/60001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc File chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc (right): https://codereview.chromium.org/2952583002/diff/60001/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc#newcode1483 chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc:1483: if (base::CommandLine::ForCurrentProcess()->HasSwitch( On 2017/06/21 09:38:38, yhirano wrote: > I ...
3 years, 6 months ago (2017-06-22 12:35:04 UTC) #34
Adam Rice
https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc File components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc (right): https://codereview.chromium.org/2952583002/diff/40001/components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc#newcode37 components/safe_browsing/renderer/websocket_sb_handshake_throttle.cc:37: content::RenderThread::Get()->GetConnector()->BindInterface( On 2017/06/21 16:55:06, yzshen1 wrote: > I think ...
3 years, 6 months ago (2017-06-22 13:42:44 UTC) #35
Adam Rice
+jam for OWNERS review for the added targets in components/safe_browsing/renderer/DEPS
3 years, 6 months ago (2017-06-22 13:43:49 UTC) #37
yzshen1
lgtm
3 years, 6 months ago (2017-06-22 15:11:07 UTC) #38
Adam Rice
jam, can you also review //android_webview and //chrome/renderer, or would you like a specific reviewer ...
3 years, 6 months ago (2017-06-22 15:17:05 UTC) #41
jam
On 2017/06/22 15:17:05, Adam Rice wrote: > jam, can you also review //android_webview and //chrome/renderer, ...
3 years, 6 months ago (2017-06-22 17:30:01 UTC) #44
yzshen1
On 2017/06/22 17:30:01, jam wrote: > On 2017/06/22 15:17:05, Adam Rice wrote: > > jam, ...
3 years, 6 months ago (2017-06-22 17:48:35 UTC) #45
Adam Rice
message: On 2017/06/22 17:30:01, jam wrote: > my only comment is: why block this on ...
3 years, 6 months ago (2017-06-23 11:07:31 UTC) #48
jam
On 2017/06/23 11:07:31, Adam Rice wrote: > message: On 2017/06/22 17:30:01, jam wrote: > > ...
3 years, 6 months ago (2017-06-23 16:40:40 UTC) #51
sgurun-gerrit only
Nate, FYI I will take a look at it monday for WebView side.
3 years, 6 months ago (2017-06-24 01:35:32 UTC) #53
Adam Rice
On 2017/06/23 16:40:40, jam wrote: > Can this cl then enable the service always and ...
3 years, 6 months ago (2017-06-26 02:56:47 UTC) #54
Adam Rice
jam: ping for DEPS and //chrome/renderer
3 years, 5 months ago (2017-06-27 01:01:17 UTC) #55
jam
On 2017/06/26 02:56:47, Adam Rice wrote: > On 2017/06/23 16:40:40, jam wrote: > > Can ...
3 years, 5 months ago (2017-06-27 01:36:28 UTC) #56
jam
lgtm with removing the DCHECKs (Adam and I chatted; he thought there isn't a point ...
3 years, 5 months ago (2017-06-27 01:47:31 UTC) #57
Adam Rice
https://codereview.chromium.org/2952583002/diff/180001/android_webview/renderer/aw_content_renderer_client.cc File android_webview/renderer/aw_content_renderer_client.cc (right): https://codereview.chromium.org/2952583002/diff/180001/android_webview/renderer/aw_content_renderer_client.cc#newcode344 android_webview/renderer/aw_content_renderer_client.cc:344: DCHECK(safe_browsing_); On 2017/06/27 01:36:28, jam wrote: > ditto Done. ...
3 years, 5 months ago (2017-06-27 02:17:06 UTC) #59
Adam Rice
sgurun, have you had a chance to look at this?
3 years, 5 months ago (2017-06-27 02:17:40 UTC) #61
sgurun-gerrit only
On 2017/06/27 02:17:40, Adam Rice wrote: > sgurun, have you had a chance to look ...
3 years, 5 months ago (2017-06-27 21:05:35 UTC) #64
sgurun-gerrit only
On 2017/06/27 21:05:35, sgurun wrote: > On 2017/06/27 02:17:40, Adam Rice wrote: > > sgurun, ...
3 years, 5 months ago (2017-06-27 22:01:57 UTC) #65
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/2952583002/200001
3 years, 5 months ago (2017-06-28 04:09:54 UTC) #68
commit-bot: I haz the power
3 years, 5 months ago (2017-06-28 05:53:46 UTC) #71
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/4ce57e66544e783efe1ae05548c2...

Powered by Google App Engine
This is Rietveld 408576698