summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h
blob: b6aba6544ece699829f14b35fcd3a4c7aa0f47cd (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
27
28
29
30
31
32
33
34
35
// 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 THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_SANITIZE_SCRIPT_ERRORS_H_
#define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_SANITIZE_SCRIPT_ERRORS_H_

namespace blink {

// https://html.spec.whatwg.org/C/webappapis.html#muted-errors
// "A boolean which, if true, means that error information will not be provided
// for errors in this script. This is used to mute errors for cross-origin
// scripts, since that can leak private information."
//
// For example:
//  - A classic script from a cross-origin url without a "crossorigin" attribute
//    has "kSanitize" flag.
//  - A classic script from a cross-origin url with a "crossorigin" attribute
//    has "kDoNotSanitize" flag.
//  - A classic script from a same-origin url has "kDoNotSanitize" flag.
//
// "Muting" here usually means hiding error content, not hiding error
// existence. When an error is muted, a sanitized error instance is dispatched
// instead of the original error. But in the promise unhandled rejection case,
// error existence is hidden when kSanitize is specified.
enum class SanitizeScriptErrors {
  // "muted errors" is false
  kDoNotSanitize,
  // "muted errors" is true
  kSanitize
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_SCRIPT_SANITIZE_ERRORS_H_