| 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 #include "components/content_settings/core/common/content_settings_pattern.h" | 5 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 // //////////////////////////////////////////////////////////////////////////// | 327 // //////////////////////////////////////////////////////////////////////////// |
| 328 // ContentSettingsPattern::PatternParts | 328 // ContentSettingsPattern::PatternParts |
| 329 // | 329 // |
| 330 ContentSettingsPattern::PatternParts::PatternParts() | 330 ContentSettingsPattern::PatternParts::PatternParts() |
| 331 : is_scheme_wildcard(false), | 331 : is_scheme_wildcard(false), |
| 332 has_domain_wildcard(false), | 332 has_domain_wildcard(false), |
| 333 is_port_wildcard(false), | 333 is_port_wildcard(false), |
| 334 is_path_wildcard(false) {} | 334 is_path_wildcard(false) {} |
| 335 | 335 |
| 336 ContentSettingsPattern::PatternParts::PatternParts(const PatternParts& other) = |
| 337 default; |
| 338 |
| 336 ContentSettingsPattern::PatternParts::~PatternParts() {} | 339 ContentSettingsPattern::PatternParts::~PatternParts() {} |
| 337 | 340 |
| 338 // //////////////////////////////////////////////////////////////////////////// | 341 // //////////////////////////////////////////////////////////////////////////// |
| 339 // ContentSettingsPattern | 342 // ContentSettingsPattern |
| 340 // | 343 // |
| 341 | 344 |
| 342 // The version of the pattern format implemented. Version 1 includes the | 345 // The version of the pattern format implemented. Version 1 includes the |
| 343 // following patterns: | 346 // following patterns: |
| 344 // - [*.]domain.tld (matches domain.tld and all sub-domains) | 347 // - [*.]domain.tld (matches domain.tld and all sub-domains) |
| 345 // - host (matches an exact hostname) | 348 // - host (matches an exact hostname) |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 if (!parts.is_path_wildcard && other_parts.is_path_wildcard) | 737 if (!parts.is_path_wildcard && other_parts.is_path_wildcard) |
| 735 return ContentSettingsPattern::PREDECESSOR; | 738 return ContentSettingsPattern::PREDECESSOR; |
| 736 | 739 |
| 737 int result = parts.path.compare(other_parts.path); | 740 int result = parts.path.compare(other_parts.path); |
| 738 if (result == 0) | 741 if (result == 0) |
| 739 return ContentSettingsPattern::IDENTITY; | 742 return ContentSettingsPattern::IDENTITY; |
| 740 if (result > 0) | 743 if (result > 0) |
| 741 return ContentSettingsPattern::DISJOINT_ORDER_PRE; | 744 return ContentSettingsPattern::DISJOINT_ORDER_PRE; |
| 742 return ContentSettingsPattern::DISJOINT_ORDER_POST; | 745 return ContentSettingsPattern::DISJOINT_ORDER_POST; |
| 743 } | 746 } |
| OLD | NEW |