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 // The rules for parsing content-types were borrowed from Firefox: | 5 // The rules for parsing content-types were borrowed from Firefox: |
6 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 | 6 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 |
7 | 7 |
8 #include "net/http/http_util.h" | 8 #include "net/http/http_util.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
857 std::string::const_iterator end, | 857 std::string::const_iterator end, |
858 char delimiter, | 858 char delimiter, |
859 OptionalValues optional_values) | 859 OptionalValues optional_values) |
860 : props_(begin, end, delimiter), | 860 : props_(begin, end, delimiter), |
861 valid_(true), | 861 valid_(true), |
862 name_begin_(end), | 862 name_begin_(end), |
863 name_end_(end), | 863 name_end_(end), |
864 value_begin_(end), | 864 value_begin_(end), |
865 value_end_(end), | 865 value_end_(end), |
866 value_is_quoted_(false), | 866 value_is_quoted_(false), |
867 values_optional_(optional_values == VALUES_OPTIONAL) {} | 867 values_optional_(optional_values == VALUES_OPTIONAL) { |
868 } | |
davidben
2015/07/23 00:09:42
Stray change? (I'm guessing a rebase went funny.)
estark
2015/07/23 02:41:22
Done.
| |
868 | 869 |
869 HttpUtil::NameValuePairsIterator::NameValuePairsIterator( | 870 HttpUtil::NameValuePairsIterator::NameValuePairsIterator( |
870 std::string::const_iterator begin, | 871 std::string::const_iterator begin, |
871 std::string::const_iterator end, | 872 std::string::const_iterator end, |
872 char delimiter) | 873 char delimiter) |
873 : NameValuePairsIterator(begin, end, delimiter, VALUES_NOT_OPTIONAL) {} | 874 : NameValuePairsIterator(begin, end, delimiter, VALUES_NOT_OPTIONAL) { |
875 } | |
874 | 876 |
875 HttpUtil::NameValuePairsIterator::~NameValuePairsIterator() {} | 877 HttpUtil::NameValuePairsIterator::~NameValuePairsIterator() {} |
876 | 878 |
877 // We expect properties to be formatted as one of: | 879 // We expect properties to be formatted as one of: |
878 // name="value" | 880 // name="value" |
879 // name='value' | 881 // name='value' |
880 // name='\'value\'' | 882 // name='\'value\'' |
881 // name=value | 883 // name=value |
882 // name = value | 884 // name = value |
883 // name (if values_optional_ is true) | 885 // name (if values_optional_ is true) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
935 value_is_quoted_ = true; | 937 value_is_quoted_ = true; |
936 // Do not store iterators into this. See declaration of unquoted_value_. | 938 // Do not store iterators into this. See declaration of unquoted_value_. |
937 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); | 939 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); |
938 } | 940 } |
939 } | 941 } |
940 | 942 |
941 return true; | 943 return true; |
942 } | 944 } |
943 | 945 |
944 } // namespace net | 946 } // namespace net |
OLD | NEW |