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

Side by Side Diff: components/url_pattern_index/url_pattern_index.h

Issue 2954613002: UrlPatternIndex: Introduce ElementType and ActivationType enums to url_pattern_index schema. (Closed)
Patch Set: Format Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_URL_PATTERN_INDEX_URL_PATTERN_INDEX_H_ 5 #ifndef COMPONENTS_URL_PATTERN_INDEX_URL_PATTERN_INDEX_H_
6 #define COMPONENTS_URL_PATTERN_INDEX_URL_PATTERN_INDEX_H_ 6 #define COMPONENTS_URL_PATTERN_INDEX_URL_PATTERN_INDEX_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // registry_controlled_domains library, to reflect the relation between 109 // registry_controlled_domains library, to reflect the relation between
110 // |url| and |first_party_origin|. 110 // |url| and |first_party_origin|.
111 // 111 //
112 // A rule is deemed to match the request iff all of the following applies: 112 // A rule is deemed to match the request iff all of the following applies:
113 // - The |url| matches the rule's UrlPattern (see url_pattern.h). 113 // - The |url| matches the rule's UrlPattern (see url_pattern.h).
114 // - The |first_party_origin| matches the rule's targeted domains list. 114 // - The |first_party_origin| matches the rule's targeted domains list.
115 // - |element_type| or |activation_type| is among the rule's targeted types. 115 // - |element_type| or |activation_type| is among the rule's targeted types.
116 // - The |is_third_party| bit matches the rule's requirement on the requested 116 // - The |is_third_party| bit matches the rule's requirement on the requested
117 // |url| being first-/third-party w.r.t. its |first_party_origin|. 117 // |url| being first-/third-party w.r.t. its |first_party_origin|.
118 // - The rule is not generic if |disable_generic_rules| is true. 118 // - The rule is not generic if |disable_generic_rules| is true.
119 const flat::UrlRule* FindMatch(const GURL& url, 119 const flat::UrlRule* FindMatch(const GURL& url,
pkalinnikov 2017/06/28 15:59:43 Do you mean this method and proto-specific code to
karandeepb 2017/06/29 00:58:18 Eventually yeah this should be removed, however I
pkalinnikov 2017/06/29 09:19:16 I can do that, no worries.
120 const url::Origin& first_party_origin, 120 const url::Origin& first_party_origin,
121 proto::ElementType element_type, 121 proto::ElementType element_type,
122 proto::ActivationType activation_type, 122 proto::ActivationType activation_type,
123 bool is_third_party, 123 bool is_third_party,
124 bool disable_generic_rules) const; 124 bool disable_generic_rules) const;
125 125
126 private: 126 private:
127 const flat::UrlRule* FindMatch(const GURL& url,
128 const url::Origin& first_party_origin,
129 flat::ElementType element_type,
130 flat::ActivationType activation_type,
131 bool is_third_party,
132 bool disable_generic_rules) const;
133
127 // Must outlive this instance. 134 // Must outlive this instance.
128 const flat::UrlPatternIndex* flat_index_; 135 const flat::UrlPatternIndex* flat_index_;
129 136
130 DISALLOW_COPY_AND_ASSIGN(UrlPatternIndexMatcher); 137 DISALLOW_COPY_AND_ASSIGN(UrlPatternIndexMatcher);
131 }; 138 };
132 139
133 } // namespace url_pattern_index 140 } // namespace url_pattern_index
134 141
135 #endif // COMPONENTS_URL_PATTERN_INDEX_URL_PATTERN_INDEX_H_ 142 #endif // COMPONENTS_URL_PATTERN_INDEX_URL_PATTERN_INDEX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698