OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 header parsing were borrowed from Firefox: | 5 // The rules for header parsing were borrowed from Firefox: |
6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo
nseHead.cpp | 6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo
nseHead.cpp |
7 // The rules for parsing content-types were also borrowed from Firefox: | 7 // The rules for parsing content-types were also borrowed from Firefox: |
8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 | 8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 |
9 | 9 |
10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/pickle.h" | 15 #include "base/pickle.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "net/base/escape.h" | 18 #include "net/base/escape.h" |
19 #include "net/http/http_util.h" | 19 #include "net/http/http_util.h" |
20 | 20 |
| 21 using base::Time; |
| 22 using base::TimeDelta; |
| 23 |
21 namespace net { | 24 namespace net { |
22 | 25 |
23 //----------------------------------------------------------------------------- | 26 //----------------------------------------------------------------------------- |
24 | 27 |
25 namespace { | 28 namespace { |
26 | 29 |
27 // These response headers are not persisted in a cached representation of the | 30 // These response headers are not persisted in a cached representation of the |
28 // response headers. (This list comes from Mozilla's nsHttpResponseHead.cpp) | 31 // response headers. (This list comes from Mozilla's nsHttpResponseHead.cpp) |
29 const char* const kTransientHeaders[] = { | 32 const char* const kTransientHeaders[] = { |
30 "connection", | 33 "connection", |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 int64 result; | 933 int64 result; |
931 bool ok = StringToInt64(content_length_val, &result); | 934 bool ok = StringToInt64(content_length_val, &result); |
932 if (!ok || result < 0) | 935 if (!ok || result < 0) |
933 return -1; | 936 return -1; |
934 | 937 |
935 return result; | 938 return result; |
936 } | 939 } |
937 | 940 |
938 } // namespace net | 941 } // namespace net |
939 | 942 |
OLD | NEW |