OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 valid_(true), | 799 valid_(true), |
800 begin_(begin), | 800 begin_(begin), |
801 end_(end), | 801 end_(end), |
802 name_begin_(end), | 802 name_begin_(end), |
803 name_end_(end), | 803 name_end_(end), |
804 value_begin_(end), | 804 value_begin_(end), |
805 value_end_(end), | 805 value_end_(end), |
806 value_is_quoted_(false) { | 806 value_is_quoted_(false) { |
807 } | 807 } |
808 | 808 |
| 809 HttpUtil::NameValuePairsIterator::~NameValuePairsIterator() {} |
| 810 |
809 // We expect properties to be formatted as one of: | 811 // We expect properties to be formatted as one of: |
810 // name="value" | 812 // name="value" |
811 // name='value' | 813 // name='value' |
812 // name='\'value\'' | 814 // name='\'value\'' |
813 // name=value | 815 // name=value |
814 // name = value | 816 // name = value |
815 // name= | 817 // name= |
816 // Due to buggy implementations found in some embedded devices, we also | 818 // Due to buggy implementations found in some embedded devices, we also |
817 // accept values with missing close quotemark (http://crbug.com/39836): | 819 // accept values with missing close quotemark (http://crbug.com/39836): |
818 // name="value | 820 // name="value |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 value_is_quoted_ = true; | 863 value_is_quoted_ = true; |
862 // Do not store iterators into this. See declaration of unquoted_value_. | 864 // Do not store iterators into this. See declaration of unquoted_value_. |
863 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); | 865 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); |
864 } | 866 } |
865 } | 867 } |
866 | 868 |
867 return true; | 869 return true; |
868 } | 870 } |
869 | 871 |
870 } // namespace net | 872 } // namespace net |
OLD | NEW |