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

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

Issue 2839683003: Server-Timing (Closed)
Patch Set: make those robots happy, attempt #4 Created 3 years, 7 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 double max_age; 74 double max_age;
75 75
76 CacheControlHeader() 76 CacheControlHeader()
77 : parsed(false), 77 : parsed(false),
78 contains_no_cache(false), 78 contains_no_cache(false),
79 contains_no_store(false), 79 contains_no_store(false),
80 contains_must_revalidate(false), 80 contains_must_revalidate(false),
81 max_age(0.0) {} 81 max_age(0.0) {}
82 }; 82 };
83 83
84 struct ServerTimingHeader {
85 String metric;
86 double duration;
87 String description;
88
89 ServerTimingHeader(String metric, double duration, String description)
90 : metric(metric), duration(duration), description(description) {}
91 };
92
93 using ServerTimingHeaderVector = Vector<std::unique_ptr<ServerTimingHeader>>;
94
84 PLATFORM_EXPORT bool IsContentDispositionAttachment(const String&); 95 PLATFORM_EXPORT bool IsContentDispositionAttachment(const String&);
85 PLATFORM_EXPORT bool IsValidHTTPHeaderValue(const String&); 96 PLATFORM_EXPORT bool IsValidHTTPHeaderValue(const String&);
86 PLATFORM_EXPORT bool IsValidHTTPFieldContentRFC7230(const String&); 97 PLATFORM_EXPORT bool IsValidHTTPFieldContentRFC7230(const String&);
87 // Checks whether the given string conforms to the |token| ABNF production 98 // Checks whether the given string conforms to the |token| ABNF production
88 // defined in the RFC 7230 or not. 99 // defined in the RFC 7230 or not.
89 // 100 //
90 // The ABNF is for validating octets, but this method takes a String instance 101 // The ABNF is for validating octets, but this method takes a String instance
91 // for convenience which consists of Unicode code points. When this method sees 102 // for convenience which consists of Unicode code points. When this method sees
92 // non-ASCII characters, it just returns false. 103 // non-ASCII characters, it just returns false.
93 PLATFORM_EXPORT bool IsValidHTTPToken(const String&); 104 PLATFORM_EXPORT bool IsValidHTTPToken(const String&);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // The following values will be outputted: 166 // The following values will be outputted:
156 // |*first_byte_position| = inclusive position of the first byte of the range 167 // |*first_byte_position| = inclusive position of the first byte of the range
157 // |*last_byte_position| = inclusive position of the last byte of the range 168 // |*last_byte_position| = inclusive position of the last byte of the range
158 // |*instance_length| = size in bytes of the object requested 169 // |*instance_length| = size in bytes of the object requested
159 // If this method returns false, then all of the outputs will be -1. 170 // If this method returns false, then all of the outputs will be -1.
160 PLATFORM_EXPORT bool ParseContentRangeHeaderFor206(const String& content_range, 171 PLATFORM_EXPORT bool ParseContentRangeHeaderFor206(const String& content_range,
161 int64_t* first_byte_position, 172 int64_t* first_byte_position,
162 int64_t* last_byte_position, 173 int64_t* last_byte_position,
163 int64_t* instance_length); 174 int64_t* instance_length);
164 175
176 PLATFORM_EXPORT std::unique_ptr<ServerTimingHeaderVector>
177 ParseServerTimingHeader(const String&);
178
179 PLATFORM_EXPORT String CheckDoubleQuotedString(const String&);
180
165 } // namespace blink 181 } // namespace blink
166 182
167 #endif 183 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698