| 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 21 matching lines...) Expand all Loading... |
| 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 "platform/json/JSONValues.h" |
| 36 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
| 37 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 38 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
| 39 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 40 #include "wtf/text/StringHash.h" | 40 #include "wtf/text/StringHash.h" |
| 41 | 41 |
| 42 #include <stdint.h> |
| 42 #include <memory> | 43 #include <memory> |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 class Suborigin; | 47 class Suborigin; |
| 47 class ResourceResponse; | 48 class ResourceResponse; |
| 48 | 49 |
| 49 typedef enum { | 50 typedef enum { |
| 50 ContentDispositionNone, | 51 ContentDispositionNone, |
| 51 ContentDispositionInline, | 52 ContentDispositionInline, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 size_t* end); | 152 size_t* end); |
| 152 | 153 |
| 153 // Parses a header value containing JSON data, according to | 154 // Parses a header value containing JSON data, according to |
| 154 // https://tools.ietf.org/html/draft-ietf-httpbis-jfv-01 | 155 // https://tools.ietf.org/html/draft-ietf-httpbis-jfv-01 |
| 155 // Returns an empty unique_ptr if the header cannot be parsed as JSON. JSON | 156 // Returns an empty unique_ptr if the header cannot be parsed as JSON. JSON |
| 156 // strings which represent object nested deeper than |maxParseDepth| will also | 157 // strings which represent object nested deeper than |maxParseDepth| will also |
| 157 // cause an empty return value. | 158 // cause an empty return value. |
| 158 PLATFORM_EXPORT std::unique_ptr<JSONArray> parseJSONHeader(const String& header, | 159 PLATFORM_EXPORT std::unique_ptr<JSONArray> parseJSONHeader(const String& header, |
| 159 int maxParseDepth); | 160 int maxParseDepth); |
| 160 | 161 |
| 162 // Extracts the values in a Content-Range header and returns true if all three |
| 163 // values are present and valid for a 206 response; otherwise returns false. |
| 164 // The following values will be outputted: |
| 165 // |*first_byte_position| = inclusive position of the first byte of the range |
| 166 // |*last_byte_position| = inclusive position of the last byte of the range |
| 167 // |*instance_length| = size in bytes of the object requested |
| 168 // If this method returns false, then all of the outputs will be -1. |
| 169 PLATFORM_EXPORT bool parseContentRangeHeaderFor206(const String& contentRange, |
| 170 int64_t* firstBytePosition, |
| 171 int64_t* lastBytePosition, |
| 172 int64_t* instanceLength); |
| 173 |
| 161 } // namespace blink | 174 } // namespace blink |
| 162 | 175 |
| 163 #endif | 176 #endif |
| OLD | NEW |