OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
4 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 4 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef HTTPParsers_h | 31 #ifndef HTTPParsers_h |
32 #define HTTPParsers_h | 32 #define HTTPParsers_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/json/JSONValues.h" |
35 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
36 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
37 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 #include "wtf/text/StringHash.h" | 40 #include "wtf/text/StringHash.h" |
40 | 41 |
| 42 #include <memory> |
| 43 |
41 namespace blink { | 44 namespace blink { |
42 | 45 |
43 class Suborigin; | 46 class Suborigin; |
44 class ResourceResponse; | 47 class ResourceResponse; |
45 | 48 |
46 typedef enum { | 49 typedef enum { |
47 ContentDispositionNone, | 50 ContentDispositionNone, |
48 ContentDispositionInline, | 51 ContentDispositionInline, |
49 ContentDispositionAttachment, | 52 ContentDispositionAttachment, |
50 ContentDispositionOther | 53 ContentDispositionOther |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 PLATFORM_EXPORT ContentTypeOptionsDisposition | 153 PLATFORM_EXPORT ContentTypeOptionsDisposition |
151 parseContentTypeOptionsHeader(const String& header); | 154 parseContentTypeOptionsHeader(const String& header); |
152 | 155 |
153 // Returns true and stores the position of the end of the headers to |*end| | 156 // Returns true and stores the position of the end of the headers to |*end| |
154 // if the headers part ends in |bytes[0..size]|. Returns false otherwise. | 157 // if the headers part ends in |bytes[0..size]|. Returns false otherwise. |
155 PLATFORM_EXPORT bool parseMultipartHeadersFromBody(const char* bytes, | 158 PLATFORM_EXPORT bool parseMultipartHeadersFromBody(const char* bytes, |
156 size_t, | 159 size_t, |
157 ResourceResponse*, | 160 ResourceResponse*, |
158 size_t* end); | 161 size_t* end); |
159 | 162 |
| 163 // Parses a header value containing JSON data, according to |
| 164 // https://tools.ietf.org/html/draft-ietf-httpbis-jfv-01 |
| 165 // Returns an empty unique_ptr if the header cannot be parsed as JSON. |
| 166 PLATFORM_EXPORT std::unique_ptr<JSONArray> parseJSONHeader( |
| 167 const String& header); |
| 168 |
160 } // namespace blink | 169 } // namespace blink |
161 | 170 |
162 #endif | 171 #endif |
OLD | NEW |