| 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..ea5478aea9df3e1fe182d262f609b28af2d0183a 100644
|
| --- a/chrome/common/content_settings_pattern.h
|
| +++ b/chrome/common/content_settings_pattern.h
|
| @@ -11,14 +11,13 @@
|
| #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 {
|
| +class ContentSettingsClient;
|
| class PatternParser;
|
| }
|
|
|
| @@ -131,12 +130,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 +150,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(
|
| + content_settings::ContentSettingsClient* client,
|
| const std::string& pattern_spec);
|
|
|
| // Constructs an empty pattern. Empty patterns are invalid patterns. Invalid
|
| @@ -180,7 +172,7 @@ class ContentSettingsPattern {
|
| bool MatchesAllHosts() const;
|
|
|
| // Returns a std::string representation of this pattern.
|
| - const std::string ToString() const;
|
| + std::string ToString(content_settings::ContentSettingsClient* client) const;
|
|
|
| // Compares the pattern with a given |other| pattern and returns the
|
| // |Relation| of the two patterns.
|
| @@ -200,54 +192,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 +217,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_
|
|
|