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

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

Issue 2799093004: Enable ServerTiming support
Patch Set: Created 3 years, 8 months 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 double maxAge; 81 double maxAge;
82 82
83 CacheControlHeader() 83 CacheControlHeader()
84 : parsed(false), 84 : parsed(false),
85 containsNoCache(false), 85 containsNoCache(false),
86 containsNoStore(false), 86 containsNoStore(false),
87 containsMustRevalidate(false), 87 containsMustRevalidate(false),
88 maxAge(0.0) {} 88 maxAge(0.0) {}
89 }; 89 };
90 90
91 struct ServerTimingHeader {
92 String metric;
93 double duration;
94 String description;
95
96 ServerTimingHeader(String metric, double duration, String description)
97 : metric(metric), duration(duration), description(description) {}
98 };
99
100 using ServerTimingHeaderVector = Vector<std::unique_ptr<ServerTimingHeader>>;
101
91 PLATFORM_EXPORT ContentDispositionType getContentDispositionType(const String&); 102 PLATFORM_EXPORT ContentDispositionType getContentDispositionType(const String&);
92 PLATFORM_EXPORT bool isValidHTTPHeaderValue(const String&); 103 PLATFORM_EXPORT bool isValidHTTPHeaderValue(const String&);
93 PLATFORM_EXPORT bool isValidHTTPFieldContentRFC7230(const String&); 104 PLATFORM_EXPORT bool isValidHTTPFieldContentRFC7230(const String&);
94 // Checks whether the given string conforms to the |token| ABNF production 105 // Checks whether the given string conforms to the |token| ABNF production
95 // defined in the RFC 7230 or not. 106 // defined in the RFC 7230 or not.
96 // 107 //
97 // The ABNF is for validating octets, but this method takes a String instance 108 // The ABNF is for validating octets, but this method takes a String instance
98 // for convenience which consists of Unicode code points. When this method sees 109 // for convenience which consists of Unicode code points. When this method sees
99 // non-ASCII characters, it just returns false. 110 // non-ASCII characters, it just returns false.
100 PLATFORM_EXPORT bool isValidHTTPToken(const String&); 111 PLATFORM_EXPORT bool isValidHTTPToken(const String&);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // The following values will be outputted: 173 // The following values will be outputted:
163 // |*first_byte_position| = inclusive position of the first byte of the range 174 // |*first_byte_position| = inclusive position of the first byte of the range
164 // |*last_byte_position| = inclusive position of the last byte of the range 175 // |*last_byte_position| = inclusive position of the last byte of the range
165 // |*instance_length| = size in bytes of the object requested 176 // |*instance_length| = size in bytes of the object requested
166 // If this method returns false, then all of the outputs will be -1. 177 // If this method returns false, then all of the outputs will be -1.
167 PLATFORM_EXPORT bool parseContentRangeHeaderFor206(const String& contentRange, 178 PLATFORM_EXPORT bool parseContentRangeHeaderFor206(const String& contentRange,
168 int64_t* firstBytePosition, 179 int64_t* firstBytePosition,
169 int64_t* lastBytePosition, 180 int64_t* lastBytePosition,
170 int64_t* instanceLength); 181 int64_t* instanceLength);
171 182
183 PLATFORM_EXPORT std::unique_ptr<ServerTimingHeaderVector>
184 parseServerTimingHeader(const String&);
185
186 PLATFORM_EXPORT String checkDoubleQuotedString(const String&);
187
172 } // namespace blink 188 } // namespace blink
173 189
174 #endif 190 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698