| 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 // Portions of this code based on Mozilla: | 5 // Portions of this code based on Mozilla: |
| 6 // (netwerk/cookie/src/nsCookieService.cpp) | 6 // (netwerk/cookie/src/nsCookieService.cpp) |
| 7 /* ***** BEGIN LICENSE BLOCK ***** | 7 /* ***** BEGIN LICENSE BLOCK ***** |
| 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 9 * | 9 * |
| 10 * The contents of this file are subject to the Mozilla Public License Version | 10 * The contents of this file are subject to the Mozilla Public License Version |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 | 384 |
| 385 // OK, now try to parse a value. | 385 // OK, now try to parse a value. |
| 386 std::string::const_iterator value_start, value_end; | 386 std::string::const_iterator value_start, value_end; |
| 387 ParseValue(&it, end, &value_start, &value_end); | 387 ParseValue(&it, end, &value_start, &value_end); |
| 388 | 388 |
| 389 // OK, we're finished with a Token/Value. | 389 // OK, we're finished with a Token/Value. |
| 390 pair.second = std::string(value_start, value_end); | 390 pair.second = std::string(value_start, value_end); |
| 391 | 391 |
| 392 // From RFC2109: "Attributes (names) (attr) are case-insensitive." | 392 // From RFC2109: "Attributes (names) (attr) are case-insensitive." |
| 393 if (pair_num != 0) | 393 if (pair_num != 0) |
| 394 StringToLowerASCII(&pair.first); | 394 base::StringToLowerASCII(&pair.first); |
| 395 // Ignore Set-Cookie directives contaning control characters. See | 395 // Ignore Set-Cookie directives contaning control characters. See |
| 396 // http://crbug.com/238041. | 396 // http://crbug.com/238041. |
| 397 if (!IsValidCookieAttributeValue(pair.first) || | 397 if (!IsValidCookieAttributeValue(pair.first) || |
| 398 !IsValidCookieAttributeValue(pair.second)) { | 398 !IsValidCookieAttributeValue(pair.second)) { |
| 399 pairs_.clear(); | 399 pairs_.clear(); |
| 400 break; | 400 break; |
| 401 } | 401 } |
| 402 | 402 |
| 403 pairs_.push_back(pair); | 403 pairs_.push_back(pair); |
| 404 | 404 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 for (size_t i = 0; i < arraysize(indexes); ++i) { | 489 for (size_t i = 0; i < arraysize(indexes); ++i) { |
| 490 if (*indexes[i] == index) | 490 if (*indexes[i] == index) |
| 491 *indexes[i] = 0; | 491 *indexes[i] = 0; |
| 492 else if (*indexes[i] > index) | 492 else if (*indexes[i] > index) |
| 493 --*indexes[i]; | 493 --*indexes[i]; |
| 494 } | 494 } |
| 495 pairs_.erase(pairs_.begin() + index); | 495 pairs_.erase(pairs_.begin() + index); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace | 498 } // namespace |
| OLD | NEW |