Chromium Code Reviews| Index: chrome/common/content_settings_pattern.h |
| diff --git a/chrome/common/content_settings_pattern.h b/chrome/common/content_settings_pattern.h |
| index a7b4861455efa28dd31564bf63f8b7b205ae8378..17a9a83137928ddc5ea8bae226c1e8ddc7e65b70 100644 |
| --- a/chrome/common/content_settings_pattern.h |
| +++ b/chrome/common/content_settings_pattern.h |
| @@ -11,11 +11,9 @@ |
| #include <string> |
| #include "base/basictypes.h" |
| -#include "base/compiler_specific.h" |
| #include "base/gtest_prod_util.h" |
| class GURL; |
| -class Pickle; |
| class PickleIterator; |
| namespace content_settings { |
| @@ -131,12 +129,6 @@ class ContentSettingsPattern { |
| // The version of the pattern format implemented. |
| static const int kContentSettingsPatternVersion; |
| - // The format of a domain wildcard. |
| - static const char* kDomainWildcard; |
| - |
| - // The length of kDomainWildcard (without the trailing '\0'). |
| - static const size_t kDomainWildcardLength; |
| - |
| // Returns a wildcard content settings pattern that matches all possible valid |
| // origins. |
| static ContentSettingsPattern Wildcard(); |
| @@ -157,9 +149,8 @@ class ContentSettingsPattern { |
| // - file://path (The path has to be an absolute path and start with a '/') |
| // - a.b.c.d (matches an exact IPv4 ip) |
| // - [a:b:c:d:e:f:g:h] (matches an exact IPv6 ip) |
| - static ContentSettingsPattern FromString(const std::string& pattern_spec); |
| - |
| - static ContentSettingsPattern LegacyFromString( |
| + static ContentSettingsPattern FromString( |
| + const char* extension_scheme, |
|
Bernhard Bauer
2014/08/11 14:06:44
You still have the notion of an extension scheme i
vasilii
2014/08/11 16:37:47
Vaclav's proposal was to hardcode the constant in
Bernhard Bauer
2014/08/11 16:47:15
There are two things I don't like here: One is the
|
| const std::string& pattern_spec); |
| // Constructs an empty pattern. Empty patterns are invalid patterns. Invalid |
| @@ -180,7 +171,7 @@ class ContentSettingsPattern { |
| bool MatchesAllHosts() const; |
| // Returns a std::string representation of this pattern. |
| - const std::string ToString() const; |
| + std::string ToString(const char* extension_scheme) const; |
| // Compares the pattern with a given |other| pattern and returns the |
| // |Relation| of the two patterns. |
| @@ -200,54 +191,9 @@ class ContentSettingsPattern { |
| private: |
| friend class content_settings::PatternParser; |
| - friend class Builder; |
| FRIEND_TEST_ALL_PREFIXES(ContentSettingsPatternParserTest, SerializePatterns); |
| - class Builder : public BuilderInterface { |
| - public: |
| - explicit Builder(bool use_legacy_validate); |
| - virtual ~Builder(); |
| - |
| - // Overrides BuilderInterface |
| - virtual BuilderInterface* WithPort(const std::string& port) OVERRIDE; |
| - |
| - virtual BuilderInterface* WithPortWildcard() OVERRIDE; |
| - |
| - virtual BuilderInterface* WithHost(const std::string& host) OVERRIDE; |
| - |
| - virtual BuilderInterface* WithDomainWildcard() OVERRIDE; |
| - |
| - virtual BuilderInterface* WithScheme(const std::string& scheme) OVERRIDE; |
| - |
| - virtual BuilderInterface* WithSchemeWildcard() OVERRIDE; |
| - |
| - virtual BuilderInterface* WithPath(const std::string& path) OVERRIDE; |
| - |
| - virtual BuilderInterface* WithPathWildcard() OVERRIDE; |
| - |
| - virtual BuilderInterface* Invalid() OVERRIDE; |
| - |
| - virtual ContentSettingsPattern Build() OVERRIDE; |
| - |
| - private: |
| - // Canonicalizes the pattern parts so that they are ASCII only, either |
| - // in original (if it was already ASCII) or punycode form. Returns true if |
| - // the canonicalization was successful. |
| - static bool Canonicalize(PatternParts* parts); |
| - |
| - // Returns true when the pattern |parts| represent a valid pattern. |
| - static bool Validate(const PatternParts& parts); |
| - |
| - static bool LegacyValidate(const PatternParts& parts); |
| - |
| - bool is_valid_; |
| - |
| - bool use_legacy_validate_; |
| - |
| - PatternParts parts_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(Builder); |
| - }; |
| + class Builder; |
| static Relation CompareScheme( |
| const ContentSettingsPattern::PatternParts& parts, |
| @@ -270,11 +216,4 @@ class ContentSettingsPattern { |
| bool is_valid_; |
| }; |
| -// Stream operator so ContentSettingsPattern can be used in assertion |
| -// statements. |
| -inline std::ostream& operator<<( |
| - std::ostream& out, const ContentSettingsPattern& pattern) { |
| - return out << pattern.ToString(); |
| -} |
| - |
| #endif // CHROME_COMMON_CONTENT_SETTINGS_PATTERN_H_ |