| Index: net/cookies/parsed_cookie.cc
|
| diff --git a/net/cookies/parsed_cookie.cc b/net/cookies/parsed_cookie.cc
|
| index ac3f87dd7d82659036f6862810478096c9f5c8c1..8832afdbdbc83f1a31fa1d3a7f7c7694a542ece0 100644
|
| --- a/net/cookies/parsed_cookie.cc
|
| +++ b/net/cookies/parsed_cookie.cc
|
| @@ -124,16 +124,6 @@ bool IsControlCharacter(unsigned char c) {
|
| return c <= 31;
|
| }
|
|
|
| -bool IsValidCookieAttributeValue(const std::string& value) {
|
| - // The greatest common denominator of cookie attribute values is
|
| - // <any CHAR except CTLs or ";"> according to RFC 6265.
|
| - for (std::string::const_iterator i = value.begin(); i != value.end(); ++i) {
|
| - if (IsControlCharacter(*i) || *i == ';')
|
| - return false;
|
| - }
|
| - return true;
|
| -}
|
| -
|
| } // namespace
|
|
|
| namespace net {
|
| @@ -240,6 +230,7 @@ std::string ParsedCookie::ToCookieLine() const {
|
| return out;
|
| }
|
|
|
| +// static
|
| std::string::const_iterator ParsedCookie::FindFirstTerminator(
|
| const std::string& s) {
|
| std::string::const_iterator end = s.end();
|
| @@ -251,6 +242,7 @@ std::string::const_iterator ParsedCookie::FindFirstTerminator(
|
| return end;
|
| }
|
|
|
| +// static
|
| bool ParsedCookie::ParseToken(std::string::const_iterator* it,
|
| const std::string::const_iterator& end,
|
| std::string::const_iterator* token_start,
|
| @@ -287,6 +279,7 @@ bool ParsedCookie::ParseToken(std::string::const_iterator* it,
|
| return true;
|
| }
|
|
|
| +// static
|
| void ParsedCookie::ParseValue(std::string::const_iterator* it,
|
| const std::string::const_iterator& end,
|
| std::string::const_iterator* value_start,
|
| @@ -313,6 +306,7 @@ void ParsedCookie::ParseValue(std::string::const_iterator* it,
|
| }
|
| }
|
|
|
| +// static
|
| std::string ParsedCookie::ParseTokenString(const std::string& token) {
|
| std::string::const_iterator it = token.begin();
|
| std::string::const_iterator end = FindFirstTerminator(token);
|
| @@ -323,6 +317,7 @@ std::string ParsedCookie::ParseTokenString(const std::string& token) {
|
| return std::string();
|
| }
|
|
|
| +// static
|
| std::string ParsedCookie::ParseValueString(const std::string& value) {
|
| std::string::const_iterator it = value.begin();
|
| std::string::const_iterator end = FindFirstTerminator(value);
|
| @@ -332,6 +327,17 @@ std::string ParsedCookie::ParseValueString(const std::string& value) {
|
| return std::string(value_start, value_end);
|
| }
|
|
|
| +// static
|
| +bool ParsedCookie::IsValidCookieAttributeValue(const std::string& value) {
|
| + // The greatest common denominator of cookie attribute values is
|
| + // <any CHAR except CTLs or ";"> according to RFC 6265.
|
| + for (std::string::const_iterator i = value.begin(); i != value.end(); ++i) {
|
| + if (IsControlCharacter(*i) || *i == ';')
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| // Parse all token/value pairs and populate pairs_.
|
| void ParsedCookie::ParseTokenValuePairs(const std::string& cookie_line) {
|
| pairs_.clear();
|
|
|