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" |
11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
12 #include "url/url_canon.h" | 13 #include "url/url_canon.h" |
13 | 14 |
14 namespace url_matcher { | 15 namespace url_matcher { |
15 | 16 |
16 // This set of classes implement a mapping of URL Component Patterns, such as | 17 // This set of classes implement a mapping of URL Component Patterns, such as |
17 // host_prefix, host_suffix, host_equals, ..., etc., to StringPatterns | 18 // host_prefix, host_suffix, host_equals, ..., etc., to StringPatterns |
18 // for use in substring comparisons. | 19 // for use in substring comparisons. |
19 // | 20 // |
20 // The idea of this mapping is to reduce the problem of comparing many | 21 // 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... |
1074 query_condition_iter = query_conditions.begin(); | 1075 query_condition_iter = query_conditions.begin(); |
1075 query_condition_iter != query_conditions.end(); | 1076 query_condition_iter != query_conditions.end(); |
1076 ++query_condition_iter) { | 1077 ++query_condition_iter) { |
1077 used_patterns.insert(query_condition_iter->string_pattern()->id()); | 1078 used_patterns.insert(query_condition_iter->string_pattern()->id()); |
1078 } | 1079 } |
1079 } | 1080 } |
1080 condition_factory_.ForgetUnusedPatterns(used_patterns); | 1081 condition_factory_.ForgetUnusedPatterns(used_patterns); |
1081 } | 1082 } |
1082 | 1083 |
1083 void URLMatcher::UpdateInternalDatastructures() { | 1084 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")); |
1084 UpdateSubstringSetMatcher(false); | 1089 UpdateSubstringSetMatcher(false); |
1085 UpdateSubstringSetMatcher(true); | 1090 UpdateSubstringSetMatcher(true); |
1086 UpdateRegexSetMatcher(); | 1091 UpdateRegexSetMatcher(); |
1087 UpdateTriggers(); | 1092 UpdateTriggers(); |
1088 UpdateConditionFactory(); | 1093 UpdateConditionFactory(); |
1089 } | 1094 } |
1090 | 1095 |
1091 } // namespace url_matcher | 1096 } // namespace url_matcher |
OLD | NEW |