• Karan Bhatia's avatar
    DNR: Introduce RulesetMatcherInterface, ExtensionUrlPatternIndexMatcher. · 1eef7a03
    Karan Bhatia authored
    This is a purely refactoring CL. We are adding support for regex rules to DNR.
    Currently RulesetMatcher is tasked with evaluating a single ruleset source (An
    extension can have upto two ruleset sources: static and dynamic). RulesetMatcher
    implements matching of filter list style rules supported by url_pattern_index.
    
    This CL does the following:
    - Introduce an interface called RulesetMatcherInterface.
    - Introduce ExtensionUrlPatternIndexMatcher: this will handle all filter list
      style rules within a ruleset.
    - Move most of the implementation from RulesetMatcher to
      ExtensionUrlPatternIndexMatcher. After this CL RulesetMatcher is just a
      wrapper over ExtensionUrlPatternIndexMatcher.
    - A subsequent CL will
       - Introduce RegexRulesMatcher which will handle all regex rules within a
         ruleset. It will also implement the RulesetMatcherInterface.
       - RulesetMatcher owns a ExtensionUrlPatternIndexMatcher currently.
         Subsequently it will also own a RegexRulesMatcher and combine the results
         from the two.
    
    BUG=974391
    Doc=https://docs.google.com/document/d/1mRErUMII_gSSPaHmxyn31UOYWUaZLj0xOaezekxD2-Y/edit?usp=sharing (Internal)
    
    Change-Id: I580be59c8b19840622c2c673338c0f54087f5186
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879565Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
    Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#710611}
    1eef7a03
ruleset_matcher.h 4.54 KB