Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: third_party/WebKit/Source/core/frame/csp/RemoteContentSecurityPolicy.h

Issue 2190183002: Forward CSP violation reporting from RenderFrameProxy to RenderFrameImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sanitize report endpoints from IPC against actual CSP contents. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/csp/RemoteContentSecurityPolicy.h
diff --git a/third_party/WebKit/Source/core/frame/csp/RemoteContentSecurityPolicy.h b/third_party/WebKit/Source/core/frame/csp/RemoteContentSecurityPolicy.h
new file mode 100644
index 0000000000000000000000000000000000000000..09e2123e77fea3cb78ebc2ecf91963321bbaade6
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/csp/RemoteContentSecurityPolicy.h
@@ -0,0 +1,43 @@
+// Copyright 2016 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 RemoteContentSecurityPolicy_h
+#define RemoteContentSecurityPolicy_h
+
+#include "core/frame/csp/ContentSecurityPolicy.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class RemoteFrameClient;
+
+// RemoteContentSecurityPolicy is a class that specializes some aspects of CSP
+// handling for cases when CSP is associated with a RemoteSecurityContext /
+// RemoteFrame. Such cases can occur when frame-src, parent-src or plugin-types
+// directives need to consult CSP from a parent frame and when the parent frame
+// is an OOPIF. An example of specialized behavior is
+// RemoteContentSecurityPolicy::reportViolation which needs to forward
+// processing of CSP violations into the renderer process associated with the
+// remote frame.
+//
+// TODO(lukasza): This class should no longer be needed once frame-src,
+// parent-src, plugin-types (and other similar directive) checks are moved to
+// the browser process (https://crbug.com/376522).
+class RemoteContentSecurityPolicy : public ContentSecurityPolicy {
+public:
+ static RemoteContentSecurityPolicy* create(RemoteFrameClient*);
+ ~RemoteContentSecurityPolicy() override;
+ DECLARE_VIRTUAL_TRACE();
+
+ void reportViolation(const String& directiveText, const String& effectiveDirective, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, const String& header, ViolationType, LocalFrame*, RedirectStatus, int contextLine) override;
+
+private:
+ explicit RemoteContentSecurityPolicy(RemoteFrameClient*);
+
+ Member<RemoteFrameClient> m_remoteFrameClient;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698