forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcors_util.h
33 lines (24 loc) · 1.19 KB
/
cors_util.h
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
27
28
29
30
31
32
33
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_COMMON_CORS_UTIL_H_
#define EXTENSIONS_COMMON_CORS_UTIL_H_
#include <vector>
#include "extensions/common/permissions/permissions_data.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
namespace extensions {
class Extension;
// Creates a CorsOriginPatternPtr vector that contains allowed origin list
// for the passed |extension|. Returned vector will be used to register the list
// to network::NetworkContext and blink::SecurityPolicy.
std::vector<network::mojom::CorsOriginPatternPtr>
CreateCorsOriginAccessAllowList(
const Extension& extension,
PermissionsData::EffectiveHostPermissionsMode mode);
// Creates a CorsOriginPatternPtr vector that contains blocked origin list
// for the passed |extension|. Returned vector will be used to register the list
// to network::NetworkContext and blink::SecurityPolicy.
std::vector<network::mojom::CorsOriginPatternPtr>
CreateCorsOriginAccessBlockList(const Extension& extension);
} // namespace extensions
#endif // EXTENSIONS_COMMON_CORS_UTIL_H_