cors_util.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef EXTENSIONS_COMMON_CORS_UTIL_H_
  5. #define EXTENSIONS_COMMON_CORS_UTIL_H_
  6. #include <vector>
  7. #include "services/network/public/mojom/cors_origin_pattern.mojom.h"
  8. namespace extensions {
  9. class Extension;
  10. // Creates a CorsOriginPatternPtr vector that contains allowed origin list
  11. // for the passed |extension|. Returned vector will be used to register the list
  12. // to network::NetworkContext and blink::SecurityPolicy.
  13. std::vector<network::mojom::CorsOriginPatternPtr>
  14. CreateCorsOriginAccessAllowList(const Extension& extension);
  15. // Creates a CorsOriginPatternPtr vector that contains blocked origin list
  16. // for the passed |extension|. Returned vector will be used to register the list
  17. // to network::NetworkContext and blink::SecurityPolicy.
  18. std::vector<network::mojom::CorsOriginPatternPtr>
  19. CreateCorsOriginAccessBlockList(const Extension& extension);
  20. } // namespace extensions
  21. #endif // EXTENSIONS_COMMON_CORS_UTIL_H_