Commit d9b8577d authored by yilkal's avatar yilkal Committed by Commit Bot

Manually allowed urls should not go through async filter.

This cl ensures that manually allowed urls will
always return early in SupervisedUserURLFilter.

Bug: 1131201
Change-Id: I8622737dd55aaa338b3bf46642c2650bf9b61c08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424673Reviewed-by: default avatarDan S <danan@chromium.org>
Commit-Queue: Yilkal Abe <yilkal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810216}
parent 8b9e10e7
...@@ -477,11 +477,18 @@ bool SupervisedUserURLFilter::GetFilteringBehaviorForURLWithAsyncChecks( ...@@ -477,11 +477,18 @@ bool SupervisedUserURLFilter::GetFilteringBehaviorForURLWithAsyncChecks(
const GURL& url, const GURL& url,
FilteringBehaviorCallback callback, FilteringBehaviorCallback callback,
bool skip_manual_parent_filter) const { bool skip_manual_parent_filter) const {
supervised_user_error_page::FilteringBehaviorReason reason =
supervised_user_error_page::DEFAULT;
FilteringBehavior behavior = GetFilteringBehaviorForURL(url, false, &reason);
if (behavior == ALLOW && reason != supervised_user_error_page::DEFAULT) {
std::move(callback).Run(behavior, reason, false);
for (Observer& observer : observers_)
observer.OnURLChecked(url, behavior, reason, false);
return true;
}
if (!skip_manual_parent_filter) { if (!skip_manual_parent_filter) {
supervised_user_error_page::FilteringBehaviorReason reason =
supervised_user_error_page::DEFAULT;
FilteringBehavior behavior =
GetFilteringBehaviorForURL(url, false, &reason);
// Any non-default reason trumps the async checker. // Any non-default reason trumps the async checker.
// Also, if we're blocking anyway, then there's no need to check it. // Also, if we're blocking anyway, then there's no need to check it.
if (reason != supervised_user_error_page::DEFAULT || behavior == BLOCK || if (reason != supervised_user_error_page::DEFAULT || behavior == BLOCK ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment