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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 } | 816 } |
817 return false; | 817 return false; |
818 } | 818 } |
819 | 819 |
820 HttpUtil::NameValuePairsIterator::NameValuePairsIterator( | 820 HttpUtil::NameValuePairsIterator::NameValuePairsIterator( |
821 string::const_iterator begin, | 821 string::const_iterator begin, |
822 string::const_iterator end, | 822 string::const_iterator end, |
823 char delimiter) | 823 char delimiter) |
824 : props_(begin, end, delimiter), | 824 : props_(begin, end, delimiter), |
825 valid_(true), | 825 valid_(true), |
826 begin_(begin), | |
827 end_(end), | |
828 name_begin_(end), | 826 name_begin_(end), |
829 name_end_(end), | 827 name_end_(end), |
830 value_begin_(end), | 828 value_begin_(end), |
831 value_end_(end), | 829 value_end_(end), |
832 value_is_quoted_(false) { | 830 value_is_quoted_(false) { |
833 } | 831 } |
834 | 832 |
835 HttpUtil::NameValuePairsIterator::~NameValuePairsIterator() {} | 833 HttpUtil::NameValuePairsIterator::~NameValuePairsIterator() {} |
836 | 834 |
837 // We expect properties to be formatted as one of: | 835 // We expect properties to be formatted as one of: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 value_is_quoted_ = true; | 887 value_is_quoted_ = true; |
890 // Do not store iterators into this. See declaration of unquoted_value_. | 888 // Do not store iterators into this. See declaration of unquoted_value_. |
891 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); | 889 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); |
892 } | 890 } |
893 } | 891 } |
894 | 892 |
895 return true; | 893 return true; |
896 } | 894 } |
897 | 895 |
898 } // namespace net | 896 } // namespace net |
OLD | NEW |