Commit c9e587f8 authored by Karan Bhatia's avatar Karan Bhatia Committed by Commit Bot

DNR: Ensure RulesetMatcher::RequestParams variables are always initialized.

The default RequestParams constructor is only used in tests. However currently
tests using it may not initialize all the member variables, leading to some
variables remaining uninitialized and causing unexpected results. Fix this by
providing default values.

BUG=696822

Change-Id: I682bb7157a4f1d6bef715840ef8f974be090df68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1706915
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Auto-Submit: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678469}
parent 9de7980d
...@@ -39,8 +39,9 @@ struct RequestParams { ...@@ -39,8 +39,9 @@ struct RequestParams {
// This is a pointer to a GURL. Hence the GURL must outlive this struct. // This is a pointer to a GURL. Hence the GURL must outlive this struct.
const GURL* url = nullptr; const GURL* url = nullptr;
url::Origin first_party_origin; url::Origin first_party_origin;
url_pattern_index::flat::ElementType element_type; url_pattern_index::flat::ElementType element_type =
bool is_third_party; url_pattern_index::flat::ElementType_OTHER;
bool is_third_party = false;
// A map of RulesetMatchers to results of |HasMatchingAllowRule| for this // A map of RulesetMatchers to results of |HasMatchingAllowRule| for this
// request. Used as a cache to prevent extra calls to |HasMatchingAllowRule|. // request. Used as a cache to prevent extra calls to |HasMatchingAllowRule|.
......
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