summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/script/fetch_client_settings_object_impl.h
blob: a00c6605b3a418d9e0b34bedbcbc196e653659db (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// 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_CORE_SCRIPT_FETCH_CLIENT_SETTINGS_OBJECT_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_FETCH_CLIENT_SETTINGS_OBJECT_IMPL_H_

#include "services/network/public/mojom/referrer_policy.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/security_context/insecure_request_policy.mojom-blink-forward.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_client_settings_object.h"
#include "third_party/blink/renderer/platform/loader/fetch/https_state.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier.h"

namespace blink {

class ExecutionContext;

// This is an implementation of FetchClientSettingsObject. As opposed to
// FetchClientSettingsObjectSnapshot, this refers to up-to-date values of the
// settings object.
//
// This class should be used for resource loading other than main worker
// (worklet) scripts. For the main scripts, FetchClientSettingsObjectSnapshot
// should be used. See the class level comments on that class.
class CORE_EXPORT FetchClientSettingsObjectImpl final
    : public FetchClientSettingsObject {
 public:
  explicit FetchClientSettingsObjectImpl(ExecutionContext&);
  ~FetchClientSettingsObjectImpl() override = default;

  const KURL& GlobalObjectUrl() const override;
  const KURL& BaseUrl() const override;
  const SecurityOrigin* GetSecurityOrigin() const override;
  network::mojom::ReferrerPolicy GetReferrerPolicy() const override;

  const String GetOutgoingReferrer() const override;

  HttpsState GetHttpsState() const override;

  AllowedByNosniff::MimeTypeCheck MimeTypeCheckForClassicWorkerScript()
      const override;

  network::mojom::IPAddressSpace GetAddressSpace() const override;

  mojom::blink::InsecureRequestPolicy GetInsecureRequestsPolicy()
      const override;
  const InsecureNavigationsSet& GetUpgradeInsecureNavigationsSet()
      const override;

  void Trace(Visitor* visitor) const override;

 private:
  Member<ExecutionContext> execution_context_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_FETCH_CLIENT_SETTINGS_OBJECT_IMPL_H_