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

Issue 2900563002: Network service: Safe browsing check for sub-resources from renderer. (Closed)

Created:
3 years, 7 months ago by yzshen1
Modified:
3 years, 6 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, vakh+watch_chromium.org, viettrungluu+watch_chromium.org, grt+watch_chromium.org, nasko+codewatch_chromium.org, jam, extensions-reviews_chromium.org, timvolodine, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, yzshen+watch_chromium.org, chromium-apps-reviews_chromium.org, darin (slow to review), qsr+mojo_chromium.org, vakh (use Gerrit instead), scottmg, ananta, mmenke, Randy Smith (Not in Mondays)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL: - introduces mojom interface for safe browsing URL checks. This interface is registered on each render frame. - introduces a C++ interface URLLoaderThrottle in content/ for renderers, which is similar to ResourceThrottle at the browser side; implements a subclass SafeBrowsingURLLoaderThrottle in chrome/. - extends ContentRendererClient::WillSendRequest() to also return a list of throttle objects, so that chrome can attach the safe browsing throttle. - provides ThrottlingURLLoader which wraps URLLoader(Factory) mojom interfaces and handles throttling properly. The following will be in follow-up CLs: - make sure it works on Android. The work should be minimal. But I haven't got a chance to test it on Android so I didn't bother adding Android-specific code. - delete cache entry when safe browsing considers a URL as bad. - handle sync loading. BUG=715673 Review-Url: https://codereview.chromium.org/2900563002 Cr-Commit-Position: refs/heads/master@{#476414} Committed: https://chromium.googlesource.com/chromium/src/+/2d8fb42490681813d05294e44166615c03a6aaff

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : use per-frame registration #

Patch Set 5 : roughly complete #

Patch Set 6 : . #

Patch Set 7 : merge #

Patch Set 8 : . #

Patch Set 9 : . #

Total comments: 34

Patch Set 10 : address review comments and add unittests #

Patch Set 11 : use per-process SafeBrowsing interface #

Patch Set 12 : . #

Patch Set 13 : . #

Patch Set 14 : . #

Total comments: 20

Patch Set 15 : . #

Patch Set 16 : . #

Total comments: 27

Patch Set 17 : . #

Total comments: 15

Patch Set 18 : . #

Total comments: 4

Patch Set 19 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1889 lines, -44 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_manifest_overlay.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/safe_browsing/mojo_safe_browsing_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +57 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +304 lines, -0 lines 0 comments Download
M chrome/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +12 lines, -0 lines 0 comments Download
A chrome/common/safe_browsing.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +31 lines, -0 lines 0 comments Download
M chrome/renderer/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +9 lines, -4 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +15 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +6 lines, -2 lines 0 comments Download
A chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +60 lines, -0 lines 0 comments Download
A chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +104 lines, -0 lines 0 comments Download
M content/child/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/child/request_extra_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -0 lines 0 comments Download
M content/child/resource_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +11 lines, -6 lines 0 comments Download
M content/child/resource_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +13 lines, -7 lines 0 comments Download
M content/child/resource_dispatcher_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A content/child/throttling_url_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +117 lines, -0 lines 0 comments Download
A content/child/throttling_url_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +243 lines, -0 lines 0 comments Download
A content/child/throttling_url_loader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +560 lines, -0 lines 0 comments Download
M content/child/url_loader_client_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -1 line 0 comments Download
M content/child/url_response_body_consumer_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -4 lines 0 comments Download
M content/child/web_url_loader_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -5 lines 0 comments Download
M content/public/child/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A content/public/child/url_loader_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +67 lines, -0 lines 0 comments Download
M content/public/common/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
A content/public/common/resource_type.mojom View 1 2 3 4 5 6 7 1 chunk +30 lines, -0 lines 0 comments Download
A content/public/common/resource_type.typemap View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +14 lines, -0 lines 0 comments Download
A content/public/common/resource_type_enum_traits.h View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
A content/public/common/resource_type_enum_traits.cc View 1 2 3 4 5 6 7 1 chunk +124 lines, -0 lines 0 comments Download
M content/public/common/typemaps.gni View 1 2 3 4 5 6 7 1 chunk +4 lines, -1 line 0 comments Download
M content/public/renderer/content_renderer_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +10 lines, -5 lines 0 comments Download
M content/public/renderer/content_renderer_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -4 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +6 lines, -1 line 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M extensions/shell/renderer/shell_content_renderer_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -4 lines 0 comments Download
M extensions/shell/renderer/shell_content_renderer_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 64 (34 generated)
yzshen1
Hi, Would you please take a look? Thanks! I have CC-ed people who are interested ...
3 years, 6 months ago (2017-05-24 19:25:10 UTC) #3
kinuko
Haven't looked very carefully yet but the overall structure looks reasonable to me. https://codereview.chromium.org/2900563002/diff/160001/chrome/browser/safe_browsing/safe_browsing_impl.cc File ...
3 years, 6 months ago (2017-05-25 11:30:58 UTC) #4
Adam Rice
Hooking this up to WebSockets is going to be harder than I realised, because I ...
3 years, 6 months ago (2017-05-25 11:33:24 UTC) #6
kinuko
We have resource fetch code path where frame is not really associated, e.g. for fetches ...
3 years, 6 months ago (2017-05-25 11:36:25 UTC) #7
jam
looks great, some comments https://codereview.chromium.org/2900563002/diff/160001/chrome/browser/safe_browsing/safe_browsing_impl.h File chrome/browser/safe_browsing/safe_browsing_impl.h (right): https://codereview.chromium.org/2900563002/diff/160001/chrome/browser/safe_browsing/safe_browsing_impl.h#newcode20 chrome/browser/safe_browsing/safe_browsing_impl.h:20: class SafeBrowsingImpl : public chrome::mojom::SafeBrowsing ...
3 years, 6 months ago (2017-05-25 15:45:51 UTC) #8
yzshen1
(I am still updating the CL and will reply to other comments once I upload ...
3 years, 6 months ago (2017-05-25 19:44:50 UTC) #9
yzshen1
On 2017/05/25 11:36:25, kinuko wrote: > We have resource fetch code path where frame is ...
3 years, 6 months ago (2017-05-25 19:52:50 UTC) #10
Adam Rice
On 2017/05/25 19:44:50, yzshen1 wrote: > On 2017/05/25 11:33:24, Adam Rice wrote: > > I ...
3 years, 6 months ago (2017-05-26 04:50:09 UTC) #11
kinuko
On 2017/05/25 19:52:50, yzshen1 wrote: > On 2017/05/25 11:36:25, kinuko wrote: > > We have ...
3 years, 6 months ago (2017-05-26 07:23:18 UTC) #12
yzshen1
On 2017/05/26 07:23:18, kinuko wrote: > On 2017/05/25 19:52:50, yzshen1 wrote: > > On 2017/05/25 ...
3 years, 6 months ago (2017-05-26 20:43:43 UTC) #13
yzshen1
https://codereview.chromium.org/2900563002/diff/160001/chrome/browser/safe_browsing/safe_browsing_impl.cc File chrome/browser/safe_browsing/safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/160001/chrome/browser/safe_browsing/safe_browsing_impl.cc#newcode53 chrome/browser/safe_browsing/safe_browsing_impl.cc:53: On 2017/05/25 11:30:57, kinuko wrote: > nit: extra empty ...
3 years, 6 months ago (2017-05-26 20:43:53 UTC) #14
jam
lgtm
3 years, 6 months ago (2017-05-26 22:43:55 UTC) #27
Adam Rice
https://codereview.chromium.org/2900563002/diff/260001/chrome/common/safe_browsing.mojom File chrome/common/safe_browsing.mojom (right): https://codereview.chromium.org/2900563002/diff/260001/chrome/common/safe_browsing.mojom#newcode10 chrome/common/safe_browsing.mojom:10: interface SafeBrowsing { FYI: I need this to be ...
3 years, 6 months ago (2017-05-29 02:18:41 UTC) #32
kinuko
Looking pretty good. https://codereview.chromium.org/2900563002/diff/260001/chrome/browser/safe_browsing/safe_browsing_impl.cc File chrome/browser/safe_browsing/safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/260001/chrome/browser/safe_browsing/safe_browsing_impl.cc#newcode102 chrome/browser/safe_browsing/safe_browsing_impl.cc:102: callbacks_[next_index_].Reset(); Can we use OnceCallback here? ...
3 years, 6 months ago (2017-05-29 13:36:50 UTC) #33
Tom Sepez
LGTM. This looks OK, but keep me in the loop about the cache design.
3 years, 6 months ago (2017-05-30 20:18:23 UTC) #34
yzshen1
Thanks Kinuko and Adam. PTAL https://codereview.chromium.org/2900563002/diff/260001/chrome/browser/safe_browsing/safe_browsing_impl.cc File chrome/browser/safe_browsing/safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/260001/chrome/browser/safe_browsing/safe_browsing_impl.cc#newcode102 chrome/browser/safe_browsing/safe_browsing_impl.cc:102: callbacks_[next_index_].Reset(); On 2017/05/29 13:36:50, ...
3 years, 6 months ago (2017-05-31 00:30:08 UTC) #36
Adam Rice
lgtm for use with WebSocket. I will defer to other reviewers for the other aspects. ...
3 years, 6 months ago (2017-05-31 06:08:51 UTC) #40
kinuko
lgtm
3 years, 6 months ago (2017-05-31 06:35:00 UTC) #41
Nathan Parker
SafeBrowsing*: My comments are mostly on naming, and requests for additional comments. Otherwise looks good. ...
3 years, 6 months ago (2017-05-31 17:17:06 UTC) #42
yzshen1
Thanks! https://codereview.chromium.org/2900563002/diff/300001/chrome/browser/safe_browsing/safe_browsing_impl.cc File chrome/browser/safe_browsing/safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/300001/chrome/browser/safe_browsing/safe_browsing_impl.cc#newcode26 chrome/browser/safe_browsing/safe_browsing_impl.cc:26: // TODO(yzshen): Share such value with safe_browsing::BaseResourceThrottle. On ...
3 years, 6 months ago (2017-05-31 23:34:44 UTC) #45
vakh (use Gerrit instead)
Thanks for doing this work. I have to admit that I tried hard to follow ...
3 years, 6 months ago (2017-05-31 23:53:09 UTC) #47
vakh (use Gerrit instead)
https://codereview.chromium.org/2900563002/diff/160001/chrome/common/safe_browsing.mojom File chrome/common/safe_browsing.mojom (right): https://codereview.chromium.org/2900563002/diff/160001/chrome/common/safe_browsing.mojom#newcode11 chrome/common/safe_browsing.mojom:11: // Queries safe browsing whether |url| is safe to ...
3 years, 6 months ago (2017-05-31 23:54:31 UTC) #48
yzshen1
Thanks Varun! > I have to admit that I tried hard to follow the logic ...
3 years, 6 months ago (2017-06-01 17:45:04 UTC) #53
vakh (use Gerrit instead)
lgtm https://codereview.chromium.org/2900563002/diff/320001/chrome/common/safe_browsing.mojom File chrome/common/safe_browsing.mojom (right): https://codereview.chromium.org/2900563002/diff/320001/chrome/common/safe_browsing.mojom#newcode24 chrome/common/safe_browsing.mojom:24: url.mojom.Url url, On 2017/06/01 17:45:04, yzshen1 wrote: > ...
3 years, 6 months ago (2017-06-01 17:57:48 UTC) #54
Nathan Parker
lgtm https://codereview.chromium.org/2900563002/diff/300001/chrome/browser/safe_browsing/safe_browsing_impl.cc File chrome/browser/safe_browsing/safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/300001/chrome/browser/safe_browsing/safe_browsing_impl.cc#newcode116 chrome/browser/safe_browsing/safe_browsing_impl.cc:116: resource.redirect_urls = On 2017/05/31 23:34:43, yzshen1 wrote: > ...
3 years, 6 months ago (2017-06-01 18:22:04 UTC) #55
yzshen1
https://codereview.chromium.org/2900563002/diff/340001/chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc File chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/340001/chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc#newcode293 chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc:293: int32_t load_flags, On 2017/06/01 18:22:04, Nathan Parker wrote: > ...
3 years, 6 months ago (2017-06-01 18:36:53 UTC) #56
Nathan Parker
lgtm https://codereview.chromium.org/2900563002/diff/340001/chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc File chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/340001/chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc#newcode293 chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc:293: int32_t load_flags, On 2017/06/01 18:36:52, yzshen1 wrote: > ...
3 years, 6 months ago (2017-06-01 18:38:49 UTC) #57
yzshen1
https://codereview.chromium.org/2900563002/diff/340001/chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc File chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc (right): https://codereview.chromium.org/2900563002/diff/340001/chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc#newcode293 chrome/browser/safe_browsing/mojo_safe_browsing_impl.cc:293: int32_t load_flags, On 2017/06/01 18:38:49, Nathan Parker wrote: > ...
3 years, 6 months ago (2017-06-01 18:44:44 UTC) #58
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/2900563002/360001
3 years, 6 months ago (2017-06-01 18:45:38 UTC) #61
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 20:29:59 UTC) #64
Message was sent while issue was closed.
Committed patchset #19 (id:360001) as
https://chromium.googlesource.com/chromium/src/+/2d8fb42490681813d05294e44166...

Powered by Google App Engine
This is Rietveld 408576698