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 #include "components/url_matcher/url_matcher.h" | 5 #include "components/url_matcher/url_matcher.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/profiler/scoped_profile.h" | |
12 #include "url/gurl.h" | 11 #include "url/gurl.h" |
13 #include "url/url_canon.h" | 12 #include "url/url_canon.h" |
14 | 13 |
15 namespace url_matcher { | 14 namespace url_matcher { |
16 | 15 |
17 // This set of classes implement a mapping of URL Component Patterns, such as | 16 // This set of classes implement a mapping of URL Component Patterns, such as |
18 // host_prefix, host_suffix, host_equals, ..., etc., to StringPatterns | 17 // host_prefix, host_suffix, host_equals, ..., etc., to StringPatterns |
19 // for use in substring comparisons. | 18 // for use in substring comparisons. |
20 // | 19 // |
21 // The idea of this mapping is to reduce the problem of comparing many | 20 // The idea of this mapping is to reduce the problem of comparing many |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 query_condition_iter = query_conditions.begin(); | 1074 query_condition_iter = query_conditions.begin(); |
1076 query_condition_iter != query_conditions.end(); | 1075 query_condition_iter != query_conditions.end(); |
1077 ++query_condition_iter) { | 1076 ++query_condition_iter) { |
1078 used_patterns.insert(query_condition_iter->string_pattern()->id()); | 1077 used_patterns.insert(query_condition_iter->string_pattern()->id()); |
1079 } | 1078 } |
1080 } | 1079 } |
1081 condition_factory_.ForgetUnusedPatterns(used_patterns); | 1080 condition_factory_.ForgetUnusedPatterns(used_patterns); |
1082 } | 1081 } |
1083 | 1082 |
1084 void URLMatcher::UpdateInternalDatastructures() { | 1083 void URLMatcher::UpdateInternalDatastructures() { |
1085 // TODO(vadimt): Remove ScopedProfile below once crbug.com/417106 is fixed. | |
1086 tracked_objects::ScopedProfile tracking_profile( | |
1087 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
1088 "URLMatcher_UpdateInternalDatastructures")); | |
1089 UpdateSubstringSetMatcher(false); | 1084 UpdateSubstringSetMatcher(false); |
1090 UpdateSubstringSetMatcher(true); | 1085 UpdateSubstringSetMatcher(true); |
1091 UpdateRegexSetMatcher(); | 1086 UpdateRegexSetMatcher(); |
1092 UpdateTriggers(); | 1087 UpdateTriggers(); |
1093 UpdateConditionFactory(); | 1088 UpdateConditionFactory(); |
1094 } | 1089 } |
1095 | 1090 |
1096 } // namespace url_matcher | 1091 } // namespace url_matcher |
OLD | NEW |