Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: third_party/WebKit/Source/platform/network/HTTPParsers.h

Issue 2543073002: Don't show a placeholder if the response contains the full image. (Closed)
Patch Set: Initial patchset Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
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 <memory> 42 #include <memory>
43 #include <stdint.h>
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,
52 ContentDispositionAttachment, 53 ContentDispositionAttachment,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 size_t* end); 162 size_t* end);
162 163
163 // Parses a header value containing JSON data, according to 164 // Parses a header value containing JSON data, according to
164 // https://tools.ietf.org/html/draft-ietf-httpbis-jfv-01 165 // https://tools.ietf.org/html/draft-ietf-httpbis-jfv-01
165 // Returns an empty unique_ptr if the header cannot be parsed as JSON. JSON 166 // Returns an empty unique_ptr if the header cannot be parsed as JSON. JSON
166 // strings which represent object nested deeper than |maxParseDepth| will also 167 // strings which represent object nested deeper than |maxParseDepth| will also
167 // cause an empty return value. 168 // cause an empty return value.
168 PLATFORM_EXPORT std::unique_ptr<JSONArray> parseJSONHeader(const String& header, 169 PLATFORM_EXPORT std::unique_ptr<JSONArray> parseJSONHeader(const String& header,
169 int maxParseDepth); 170 int maxParseDepth);
170 171
172 // Extracts the values in a Content-Range header and returns true if they are
173 // valid for a 206 response; otherwise returns false.
174 // The following values will be outputted:
175 // |*firstBytePosition| = inclusive position of the first byte of the range
176 // |*lastBytePosition| = inclusive position of the last byte of the range
177 // |*instanceLength| = size in bytes of the object requested
178 // If any of the above values is unknown, its value will be -1.
179 PLATFORM_EXPORT bool parseContentRangeHeader(const String& contentRange,
180 int64_t* firstBytePosition,
181 int64_t* lastBytePosition,
182 int64_t* instanceLength);
183
171 } // namespace blink 184 } // namespace blink
172 185
173 #endif 186 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698