summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/frame/policy_container.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-12 09:13:00 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-16 09:58:26 +0000
commit03561cae90f1d99b5c54b1ef3be69f10e882b25e (patch)
treecc5f0958e823c044e7ae51cc0117fe51432abe5e /chromium/third_party/blink/renderer/core/frame/policy_container.h
parentfa98118a45f7e169f8846086dc2c22c49a8ba310 (diff)
downloadqtwebengine-chromium-03561cae90f1d99b5c54b1ef3be69f10e882b25e.tar.gz
BASELINE: Update Chromium to 88.0.4324.208
Change-Id: I3ae87d23e4eff4b4a469685658740a213600c667 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/frame/policy_container.h')
-rw-r--r--chromium/third_party/blink/renderer/core/frame/policy_container.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/frame/policy_container.h b/chromium/third_party/blink/renderer/core/frame/policy_container.h
new file mode 100644
index 00000000000..1c7aa1661bf
--- /dev/null
+++ b/chromium/third_party/blink/renderer/core/frame/policy_container.h
@@ -0,0 +1,54 @@
+// Copyright 2020 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_FRAME_POLICY_CONTAINER_H_
+#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_POLICY_CONTAINER_H_
+
+#include "mojo/public/cpp/bindings/associated_remote.h"
+#include "services/network/public/mojom/referrer_policy.mojom-shared.h"
+#include "third_party/blink/public/mojom/frame/policy_container.mojom-blink.h"
+#include "third_party/blink/public/platform/web_policy_container.h"
+#include "third_party/blink/renderer/core/core_export.h"
+
+namespace blink {
+
+// PolicyContainer serves as a container for several security policies to be
+// applied to a document. It is constructed at commit time with the data passed
+// by the RenderFrameHost. It is Blink's counterpart of the PolicyContainerHost,
+// which is held by the RenderFrameHost. Some document policies of the policy
+// container can be updated also by Blink (this generally happens when Blink
+// parses meta tags). The corresponding setters trigger also an update in the
+// corresponding PolicyContainerHost via a mojo IPC.
+class CORE_EXPORT PolicyContainer {
+ USING_FAST_MALLOC(PolicyContainer);
+
+ public:
+ PolicyContainer() = delete;
+ PolicyContainer(
+ mojo::PendingAssociatedRemote<mojom::blink::PolicyContainerHost> remote,
+ mojom::blink::PolicyContainerDocumentPoliciesPtr policies);
+ PolicyContainer(const PolicyContainer&) = delete;
+ PolicyContainer& operator=(const PolicyContainer&) = delete;
+ ~PolicyContainer() = default;
+
+ static std::unique_ptr<PolicyContainer> CreateFromWebPolicyContainer(
+ std::unique_ptr<WebPolicyContainer> container);
+
+ // Change the Referrer Policy and sync the new policy with the corresponding
+ // PolicyContainer owned by the RenderFrameHost.
+ void UpdateReferrerPolicy(network::mojom::blink::ReferrerPolicy policy);
+ network::mojom::blink::ReferrerPolicy GetReferrerPolicy() const;
+
+ const mojom::blink::PolicyContainerDocumentPoliciesPtr& GetPolicies() const;
+
+ private:
+ mojom::blink::PolicyContainerDocumentPoliciesPtr policies_;
+
+ mojo::AssociatedRemote<mojom::blink::PolicyContainerHost>
+ policy_container_host_remote_;
+};
+
+} // namespace blink
+
+#endif