summaryrefslogtreecommitdiffstats
path: root/chromium/components/aggregation_service/parsing_utils.h
blob: 0379170dd18a95e875acd1467053a731d72c5c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_AGGREGATION_SERVICE_PARSING_UTILS_H_
#define COMPONENTS_AGGREGATION_SERVICE_PARSING_UTILS_H_

#include <string>

#include "base/component_export.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

namespace url {
class Origin;
}  // namespace url

namespace aggregation_service {

// Parses aggregation coordinator identifier. Returns `kDefault` if `str` is
// nullptr or is not a pre-defined value.
COMPONENT_EXPORT(AGGREGATION_SERVICE)
absl::optional<url::Origin> ParseAggregationCoordinator(const std::string& str);

}  // namespace aggregation_service

#endif  // COMPONENTS_AGGREGATION_SERVICE_PARSING_UTILS_H_