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

Unified Diff: third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp

Issue 2190183002: Forward CSP violation reporting from RenderFrameProxy to RenderFrameImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove no longer applicable TODO and early exit from reportViolation method. 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/dom/RemoteSecurityContext.cpp
diff --git a/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp b/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp
index dfc8610b5d16338674713bbee2e62aa45096c0f2..045fb89c3ffefc039d8a84831c673710f015f41b 100644
--- a/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp
+++ b/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp
@@ -4,34 +4,40 @@
#include "core/dom/RemoteSecurityContext.h"
-#include "core/frame/csp/ContentSecurityPolicy.h"
+#include "core/frame/RemoteFrameClient.h"
+#include "core/frame/csp/RemoteContentSecurityPolicy.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "wtf/Assertions.h"
namespace blink {
-RemoteSecurityContext::RemoteSecurityContext()
+RemoteSecurityContext::RemoteSecurityContext(RemoteFrameClient* remoteFrameClient)
: SecurityContext()
+ , m_remoteFrameClient(remoteFrameClient)
{
// RemoteSecurityContext's origin is expected to stay uninitialized until
// we set it using replicated origin data from the browser process.
DCHECK(!getSecurityOrigin());
+ // Caller needs to pass a non-null |remoteFrameClient|.
+ DCHECK(remoteFrameClient);
+
// Start with a clean slate.
- setContentSecurityPolicy(ContentSecurityPolicy::create());
+ setContentSecurityPolicy(RemoteContentSecurityPolicy::create(m_remoteFrameClient));
// FIXME: Document::initSecurityContext has a few other things we may
// eventually want here, such as enforcing a setting to
// grantUniversalAccess().
}
-RemoteSecurityContext* RemoteSecurityContext::create()
+RemoteSecurityContext* RemoteSecurityContext::create(RemoteFrameClient* remoteFrameClient)
{
- return new RemoteSecurityContext();
+ return new RemoteSecurityContext(remoteFrameClient);
}
DEFINE_TRACE(RemoteSecurityContext)
{
+ visitor->trace(m_remoteFrameClient);
SecurityContext::trace(visitor);
}
@@ -45,7 +51,7 @@ void RemoteSecurityContext::setReplicatedOrigin(PassRefPtr<SecurityOrigin> origi
void RemoteSecurityContext::resetReplicatedContentSecurityPolicy()
{
DCHECK(getSecurityOrigin());
- setContentSecurityPolicy(ContentSecurityPolicy::create());
+ setContentSecurityPolicy(RemoteContentSecurityPolicy::create(m_remoteFrameClient));
alexmos 2016/08/09 18:01:19 It's unfortunate that we need to store m_remoteFra
Łukasz Anforowicz 2016/08/09 22:23:20 Acknowledged.
contentSecurityPolicy()->setupSelf(*getSecurityOrigin());
}

Powered by Google App Engine
This is Rietveld 408576698