OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MATCHER_REGEX_SET_MATCHER_H_ | 5 #ifndef COMPONENTS_URL_MATCHER_REGEX_SET_MATCHER_H_ |
6 #define COMPONENTS_URL_MATCHER_REGEX_SET_MATCHER_H_ | 6 #define COMPONENTS_URL_MATCHER_REGEX_SET_MATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
9 #include <set> | 10 #include <set> |
10 #include <string> | 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "components/url_matcher/string_pattern.h" | 14 #include "components/url_matcher/string_pattern.h" |
15 #include "components/url_matcher/substring_set_matcher.h" | 15 #include "components/url_matcher/substring_set_matcher.h" |
16 #include "components/url_matcher/url_matcher_export.h" | 16 #include "components/url_matcher/url_matcher_export.h" |
17 | 17 |
18 namespace re2 { | 18 namespace re2 { |
19 class FilteredRE2; | 19 class FilteredRE2; |
20 } | 20 } |
21 | 21 |
22 namespace url_matcher { | 22 namespace url_matcher { |
23 | 23 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Clean up StringPatterns in |substring_patterns_|. | 64 // Clean up StringPatterns in |substring_patterns_|. |
65 void DeleteSubstringPatterns(); | 65 void DeleteSubstringPatterns(); |
66 | 66 |
67 // Mapping of regex StringPattern::IDs to regexes. | 67 // Mapping of regex StringPattern::IDs to regexes. |
68 RegexMap regexes_; | 68 RegexMap regexes_; |
69 // Mapping of RE2IDs from FilteredRE2 (which are assigned in order) | 69 // Mapping of RE2IDs from FilteredRE2 (which are assigned in order) |
70 // to regex StringPattern::IDs. | 70 // to regex StringPattern::IDs. |
71 RE2IDMap re2_id_map_; | 71 RE2IDMap re2_id_map_; |
72 | 72 |
73 scoped_ptr<re2::FilteredRE2> filtered_re2_; | 73 std::unique_ptr<re2::FilteredRE2> filtered_re2_; |
74 scoped_ptr<SubstringSetMatcher> substring_matcher_; | 74 std::unique_ptr<SubstringSetMatcher> substring_matcher_; |
75 | 75 |
76 // The substring patterns from FilteredRE2, which are used in | 76 // The substring patterns from FilteredRE2, which are used in |
77 // |substring_matcher_| but whose lifetime is managed here. | 77 // |substring_matcher_| but whose lifetime is managed here. |
78 std::vector<const StringPattern*> substring_patterns_; | 78 std::vector<const StringPattern*> substring_patterns_; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace url_matcher | 81 } // namespace url_matcher |
82 | 82 |
83 #endif // COMPONENTS_URL_MATCHER_REGEX_SET_MATCHER_H_ | 83 #endif // COMPONENTS_URL_MATCHER_REGEX_SET_MATCHER_H_ |
OLD | NEW |