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

Issue 2867833002: NavigationThrottle: allow customization of net::Error when blocking

Created:
3 years, 7 months ago by ncarter (slow)
Modified:
3 years, 3 months ago
Reviewers:
lgarron, nasko
CC:
achuith+watch_chromium.org, alemate+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, creis+watch_chromium.org, csharrison+watch_chromium.org, darin-cc_chromium.org, davemoore+watch_chromium.org, devtools-reviews_chromium.org, elijahtaylor+arcwatch_chromium.org, extensions-reviews_chromium.org, hidehiko+watch_chromium.org, jam, lhchavez+watch_chromium.org, loading-reviews_chromium.org, loading-reviews+metrics_chromium.org, mmenke, nasko+codewatch_chromium.org, oshima+watch_chromium.org, pam+watch_chromium.org, pfeldman, Randy Smith (Not in Mondays), speed-metrics-reviews_chromium.org, subresource-filter-reviews_chromium.org, victorhsieh+watch_chromium.org, yusukes+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

NavigationThrottle: allow customization of net::Error when blocking a navigation. Customizing the net error is desirable since the text of ERR_BLOCKED_BY_CLIENT currently advises the user to try disabling extensions, which can be situationally confusing (bug 649869). Throttles can now return values either like this: return PROCEED; or like this: return BLOCK_REQUEST; // uses net::ERR_BLOCKED_BY_CLIENT, as before or like this (new!): return {BLOCK_REQUEST, net::ERR_FAILED}; No throttles use the new syntax yet. BUG=649869 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Patch Set 1 #

Patch Set 2 : Fix some TRACE_EVENTS. #

Patch Set 3 : Switch to POD #

Patch Set 4 : go back to implicit #

Patch Set 5 : Fix bad DCHECK #

Patch Set 6 : CONTENT_EXPORT #

Patch Set 7 : Add unit tests. #

Total comments: 2

Patch Set 8 : nasko fixes #

Patch Set 9 : Merge remote-tracking branch 'origin/master' into kill_107_reboot2_p #

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+294 lines, -121 lines) Patch
M chrome/browser/subresource_filter/subresource_filter_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/supervised_user/supervised_user_navigation_throttle.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc View 1 2 3 4 5 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/devtools/page_navigation_throttle.cc View 1 2 3 4 5 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/frame_host/mixed_content_navigation_throttle.h View 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/frame_host/mixed_content_navigation_throttle.cc View 1 2 3 4 5 6 chunks +19 lines, -19 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 9 chunks +23 lines, -18 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl_unittest.cc View 1 2 3 4 5 6 2 chunks +88 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 3 4 5 6 7 8 9 7 chunks +24 lines, -16 lines 0 comments Download
M content/browser/loader/navigation_resource_throttle.cc View 1 2 3 4 5 4 chunks +13 lines, -9 lines 0 comments Download
M content/public/browser/navigation_handle.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/navigation_throttle.h View 1 2 3 4 5 5 chunks +80 lines, -11 lines 0 comments Download
M content/public/browser/navigation_throttle.cc View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
M content/public/test/navigation_simulator.cc View 1 2 3 4 chunks +15 lines, -27 lines 0 comments Download
M extensions/browser/extension_navigation_throttle.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 50 (43 generated)
ncarter (slow)
Fix bad DCHECK
3 years, 7 months ago (2017-05-10 18:54:39 UTC) #18
ncarter (slow)
CONTENT_EXPORT
3 years, 7 months ago (2017-05-10 20:19:08 UTC) #23
ncarter (slow)
nasko, PTAL
3 years, 7 months ago (2017-05-10 23:19:12 UTC) #31
nasko
This is awesome! I just have one comment. https://codereview.chromium.org/2867833002/diff/120001/content/browser/frame_host/navigation_request.cc File content/browser/frame_host/navigation_request.cc (right): https://codereview.chromium.org/2867833002/diff/120001/content/browser/frame_host/navigation_request.cc#newcode804 content/browser/frame_host/navigation_request.cc:804: OnRequestFailed(false, ...
3 years, 7 months ago (2017-05-11 00:09:54 UTC) #32
nasko
https://codereview.chromium.org/2867833002/diff/120001/content/public/browser/navigation_throttle.h File content/public/browser/navigation_throttle.h (right): https://codereview.chromium.org/2867833002/diff/120001/content/public/browser/navigation_throttle.h#newcode106 content/public/browser/navigation_throttle.h:106: net::Error net_error_code_ : 16; Chatting with dcheng@ over why ...
3 years, 7 months ago (2017-05-11 18:05:44 UTC) #35
lgarron
I ended up implementing pretty much the same thing for: https://chromium-review.googlesource.com/c/chromium/src/+/647656 https://chromium-review.googlesource.com/c/chromium/src/+/625337 (In fact, I ...
3 years, 3 months ago (2017-09-05 22:13:18 UTC) #49
ncarter (slow)
3 years, 3 months ago (2017-09-05 23:14:56 UTC) #50
That sounds super-reasonable, thanks!

On Tue, Sep 5, 2017 at 3:13 PM, <lgarron@chromium.org> wrote:

> I ended up implementing pretty much the same thing for:
>
> https://chromium-review.googlesource.com/c/chromium/src/+/647656
> https://chromium-review.googlesource.com/c/chromium/src/+/625337
>
> (In fact, I unintentionally performed the same swizzle of repurposing
> "ThrottleCheckResult" into a class while swizzling the old "result" type
> into
> something named "action"! :-D)
>
> However, I also need to include an optional error_page_html string.
> Here's a specific plan for meeting in the middle:
>
> - Drop the SupervisedUserNavigationThrottle-specific code for this CL.
> - Add a base::Optional<std::string> error_page_html field and remove the
> comparison operators.
> - ... don't worry about packing?
>
> Does that sound reasonable?
>
> https://codereview.chromium.org/2867833002/
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698