| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 if (match_type_ == MATCH_ANY) | 612 if (match_type_ == MATCH_ANY) |
| 613 condition = factory->CreateQueryContainsCondition(key_ + value_); | 613 condition = factory->CreateQueryContainsCondition(key_ + value_); |
| 614 else | 614 else |
| 615 condition = factory->CreateQueryContainsCondition(key_); | 615 condition = factory->CreateQueryContainsCondition(key_); |
| 616 string_pattern_ = condition.string_pattern(); | 616 string_pattern_ = condition.string_pattern(); |
| 617 | 617 |
| 618 key_length_ = key_.length(); | 618 key_length_ = key_.length(); |
| 619 value_length_ = value_.length(); | 619 value_length_ = value_.length(); |
| 620 } | 620 } |
| 621 | 621 |
| 622 URLQueryElementMatcherCondition::URLQueryElementMatcherCondition( |
| 623 const URLQueryElementMatcherCondition& other) = default; |
| 624 |
| 622 URLQueryElementMatcherCondition::~URLQueryElementMatcherCondition() {} | 625 URLQueryElementMatcherCondition::~URLQueryElementMatcherCondition() {} |
| 623 | 626 |
| 624 bool URLQueryElementMatcherCondition::operator<( | 627 bool URLQueryElementMatcherCondition::operator<( |
| 625 const URLQueryElementMatcherCondition& rhs) const { | 628 const URLQueryElementMatcherCondition& rhs) const { |
| 626 if (match_type_ != rhs.match_type_) | 629 if (match_type_ != rhs.match_type_) |
| 627 return match_type_ < rhs.match_type_; | 630 return match_type_ < rhs.match_type_; |
| 628 if (string_pattern_ != NULL && rhs.string_pattern_ != NULL) | 631 if (string_pattern_ != NULL && rhs.string_pattern_ != NULL) |
| 629 return *string_pattern_ < *rhs.string_pattern_; | 632 return *string_pattern_ < *rhs.string_pattern_; |
| 630 if (string_pattern_ == NULL && rhs.string_pattern_ != NULL) | 633 if (string_pattern_ == NULL && rhs.string_pattern_ != NULL) |
| 631 return true; | 634 return true; |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 | 1100 |
| 1098 void URLMatcher::UpdateInternalDatastructures() { | 1101 void URLMatcher::UpdateInternalDatastructures() { |
| 1099 UpdateSubstringSetMatcher(false); | 1102 UpdateSubstringSetMatcher(false); |
| 1100 UpdateSubstringSetMatcher(true); | 1103 UpdateSubstringSetMatcher(true); |
| 1101 UpdateRegexSetMatcher(); | 1104 UpdateRegexSetMatcher(); |
| 1102 UpdateTriggers(); | 1105 UpdateTriggers(); |
| 1103 UpdateConditionFactory(); | 1106 UpdateConditionFactory(); |
| 1104 } | 1107 } |
| 1105 | 1108 |
| 1106 } // namespace url_matcher | 1109 } // namespace url_matcher |
| OLD | NEW |