blob: cb2efef5d365e4172659bbbaa582957ae845579d [file] [log] [blame]
Yao Xiao3a83d792022-11-04 19:46:361// Copyright 2022 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_BROWSING_TOPICS_HEADER_UTIL_H_
6#define CONTENT_BROWSER_BROWSING_TOPICS_HEADER_UTIL_H_
7
8#include "components/browsing_topics/common/common_types.h"
9#include "content/public/browser/render_frame_host.h"
Abigail Katcoff5b171072023-04-28 14:25:0610#include "services/network/public/mojom/parsed_headers.mojom-forward.h"
Yao Xiao3a83d792022-11-04 19:46:3611#include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h"
12
13namespace content {
14
Avi Drissman3d7558df82025-08-01 17:21:2015inline constexpr char kBrowsingTopicsRequestHeaderKey[] = "Sec-Browsing-Topics";
Yao Xiao3a83d792022-11-04 19:46:3616
Yao Xiaodd39a3e2023-05-27 16:21:0617// Derive the header value for `Sec-Browsing-Topics` given `topics` and
18// `num_versions_in_epochs`.
Yao Xiao3a83d792022-11-04 19:46:3619std::string CONTENT_EXPORT
Yao Xiaodd39a3e2023-05-27 16:21:0620DeriveTopicsHeaderValue(const std::vector<blink::mojom::EpochTopicPtr>& topics,
21 int num_versions_in_epochs);
Yao Xiao3a83d792022-11-04 19:46:3622
23// Handle the response for topics eligible requests.
Abigail Katcoff5b171072023-04-28 14:25:0624void CONTENT_EXPORT HandleTopicsEligibleResponse(
25 const network::mojom::ParsedHeadersPtr& parsed_headers,
26 const url::Origin& caller_origin,
27 RenderFrameHost& request_initiator_frame,
28 browsing_topics::ApiCallerSource caller_source);
Yao Xiao3a83d792022-11-04 19:46:3629
30} // namespace content
31
32#endif // CONTENT_BROWSER_BROWSING_TOPICS_HEADER_UTIL_H_