Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(849)

Unified Diff: trunk/src/net/cookies/cookie_util.cc

Issue 385113003: Revert 282546 "Enforce SafetyMode for YouTube if prefs::kForceSa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/net/cookies/cookie_util.h ('k') | trunk/src/net/cookies/cookie_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/cookies/cookie_util.cc
===================================================================
--- trunk/src/net/cookies/cookie_util.cc (revision 282600)
+++ trunk/src/net/cookies/cookie_util.cc (working copy)
@@ -210,59 +210,6 @@
return GURL(scheme + "://" + host);
}
-void ParseRequestCookieLine(const std::string& header_value,
- ParsedRequestCookies* parsed_cookies) {
- std::string::const_iterator i = header_value.begin();
- while (i != header_value.end()) {
- // Here we are at the beginning of a cookie.
-
- // Eat whitespace.
- while (i != header_value.end() && *i == ' ') ++i;
- if (i == header_value.end()) return;
-
- // Find cookie name.
- std::string::const_iterator cookie_name_beginning = i;
- while (i != header_value.end() && *i != '=') ++i;
- base::StringPiece cookie_name(cookie_name_beginning, i);
-
- // Find cookie value.
- base::StringPiece cookie_value;
- if (i != header_value.end()) { // Cookies may have no value.
- ++i; // Skip '='.
- std::string::const_iterator cookie_value_beginning = i;
- if (*i == '"') {
- ++i; // Skip '"'.
- while (i != header_value.end() && *i != '"') ++i;
- if (i == header_value.end()) return;
- ++i; // Skip '"'.
- cookie_value = base::StringPiece(cookie_value_beginning, i);
- // i points to character after '"', potentially a ';'
- } else {
- while (i != header_value.end() && *i != ';') ++i;
- cookie_value = base::StringPiece(cookie_value_beginning, i);
- // i points to ';' or end of string.
- }
- }
- parsed_cookies->push_back(std::make_pair(cookie_name, cookie_value));
- // Eat ';'.
- if (i != header_value.end()) ++i;
- }
-}
-
-std::string SerializeRequestCookieLine(
- const ParsedRequestCookies& parsed_cookies) {
- std::string buffer;
- for (ParsedRequestCookies::const_iterator i = parsed_cookies.begin();
- i != parsed_cookies.end(); ++i) {
- if (!buffer.empty())
- buffer.append("; ");
- buffer.append(i->first.begin(), i->first.end());
- buffer.push_back('=');
- buffer.append(i->second.begin(), i->second.end());
- }
- return buffer;
-}
-
} // namespace cookie_utils
} // namespace net
« no previous file with comments | « trunk/src/net/cookies/cookie_util.h ('k') | trunk/src/net/cookies/cookie_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698