#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_NETWORK_HTTP_PARSERS_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_NETWORK_HTTP_PARSERS_H_
#include <stdint.h>
#include <memory>
#include <optional>
#include "base/time/time.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink-forward.h"
#include "services/network/public/mojom/no_vary_search.mojom-blink-forward.h"
#include "services/network/public/mojom/parsed_headers.mojom-blink-forward.h"
#include "services/network/public/mojom/timing_allow_origin.mojom-blink.h"
#include "third_party/blink/renderer/platform/network/content_security_policy_response_headers.h"
#include "third_party/blink/renderer/platform/network/parsed_content_type.h"
#include "third_party/blink/renderer/platform/network/server_timing_header.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/text/case_folding_hash.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
class HTTPHeaderMap;
class ResourceResponse;
class KURL;
enum ContentTypeOptionsDisposition { … };
CommaDelimitedHeaderSet;
struct CacheControlHeader { … };
ServerTimingHeaderVector;
PLATFORM_EXPORT bool IsContentDispositionAttachment(const String&);
PLATFORM_EXPORT bool IsValidHTTPHeaderValue(const String&);
PLATFORM_EXPORT bool IsValidHTTPToken(const String&);
PLATFORM_EXPORT bool ParseHTTPRefresh(const String& refresh,
WTF::CharacterMatchFunctionPtr matcher,
base::TimeDelta& delay,
String& url);
PLATFORM_EXPORT std::optional<base::Time> ParseDate(const String&);
PLATFORM_EXPORT AtomicString ExtractMIMETypeFromMediaType(const AtomicString&);
PLATFORM_EXPORT AtomicString MinimizedMIMEType(const AtomicString&);
PLATFORM_EXPORT CacheControlHeader
ParseCacheControlDirectives(const AtomicString& cache_control_header,
const AtomicString& pragma_header);
PLATFORM_EXPORT void ParseCommaDelimitedHeader(const String& header_value,
CommaDelimitedHeaderSet&);
PLATFORM_EXPORT ContentTypeOptionsDisposition
ParseContentTypeOptionsHeader(const String& header);
PLATFORM_EXPORT bool ParseMultipartFormHeadersFromBody(
const char* bytes,
wtf_size_t,
HTTPHeaderMap* header_fields,
wtf_size_t* end);
PLATFORM_EXPORT bool ParseMultipartHeadersFromBody(const char* bytes,
wtf_size_t,
ResourceResponse*,
wtf_size_t* end);
PLATFORM_EXPORT bool ParseContentRangeHeaderFor206(const String& content_range,
int64_t* first_byte_position,
int64_t* last_byte_position,
int64_t* instance_length);
PLATFORM_EXPORT std::unique_ptr<ServerTimingHeaderVector>
ParseServerTimingHeader(const String&);
PLATFORM_EXPORT network::mojom::blink::ParsedHeadersPtr ParseHeaders(
const String& raw_headers,
const KURL& url);
PLATFORM_EXPORT
Vector<network::mojom::blink::ContentSecurityPolicyPtr>
ParseContentSecurityPolicies(
const String& raw_policies,
network::mojom::blink::ContentSecurityPolicyType type,
network::mojom::blink::ContentSecurityPolicySource source,
const KURL& base_url);
PLATFORM_EXPORT
Vector<network::mojom::blink::ContentSecurityPolicyPtr>
ParseContentSecurityPolicies(
const String& raw_policies,
network::mojom::blink::ContentSecurityPolicyType type,
network::mojom::blink::ContentSecurityPolicySource source,
const SecurityOrigin& self_origin);
PLATFORM_EXPORT
Vector<network::mojom::blink::ContentSecurityPolicyPtr>
ParseContentSecurityPolicyHeaders(
const ContentSecurityPolicyResponseHeaders& headers);
PLATFORM_EXPORT
network::mojom::blink::TimingAllowOriginPtr ParseTimingAllowOrigin(
const String& header_value);
PLATFORM_EXPORT
network::mojom::blink::NoVarySearchWithParseErrorPtr ParseNoVarySearch(
const String& header_value);
PLATFORM_EXPORT
String GetNoVarySearchHintConsoleMessage(
const network::mojom::NoVarySearchParseError& error);
}
#endif