OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_COMMON_EXTENSIONS_MATCHER_REGEX_SET_MATCHER_H_ | 5 #ifndef EXTENSIONS_COMMON_MATCHER_REGEX_SET_MATCHER_H_ |
6 #define CHROME_COMMON_EXTENSIONS_MATCHER_REGEX_SET_MATCHER_H_ | 6 #define EXTENSIONS_COMMON_MATCHER_REGEX_SET_MATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/common/extensions/matcher/string_pattern.h" | 14 #include "extensions/common/matcher/string_pattern.h" |
15 #include "chrome/common/extensions/matcher/substring_set_matcher.h" | 15 #include "extensions/common/matcher/substring_set_matcher.h" |
16 | 16 |
17 namespace re2 { | 17 namespace re2 { |
18 class FilteredRE2; | 18 class FilteredRE2; |
19 } | 19 } |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 | 22 |
23 // Efficiently matches URLs against a collection of regular expressions, | 23 // Efficiently matches URLs against a collection of regular expressions, |
24 // using FilteredRE2 to reduce the number of regexes that must be matched | 24 // using FilteredRE2 to reduce the number of regexes that must be matched |
25 // by pre-filtering with substring matching. See: | 25 // by pre-filtering with substring matching. See: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 scoped_ptr<re2::FilteredRE2> filtered_re2_; | 70 scoped_ptr<re2::FilteredRE2> filtered_re2_; |
71 scoped_ptr<SubstringSetMatcher> substring_matcher_; | 71 scoped_ptr<SubstringSetMatcher> substring_matcher_; |
72 | 72 |
73 // The substring patterns from FilteredRE2, which are used in | 73 // The substring patterns from FilteredRE2, which are used in |
74 // |substring_matcher_| but whose lifetime is managed here. | 74 // |substring_matcher_| but whose lifetime is managed here. |
75 std::vector<const StringPattern*> substring_patterns_; | 75 std::vector<const StringPattern*> substring_patterns_; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace extensions | 78 } // namespace extensions |
79 | 79 |
80 #endif // CHROME_COMMON_EXTENSIONS_MATCHER_REGEX_SET_MATCHER_H_ | 80 #endif // EXTENSIONS_COMMON_MATCHER_REGEX_SET_MATCHER_H_ |
OLD | NEW |