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

Unified Diff: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 2001333003: Switch some clients of ScriptCallStack to SourceLocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1997293002
Patch Set: rebased Created 4 years, 7 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/ContentSecurityPolicy.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
index f0676e3db15d73b1ab85081f91b57273ccbd5e7c..71b01c8aaf560a5c8ef420f5fb029ad373eaff51 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -25,8 +25,8 @@
#include "core/frame/csp/ContentSecurityPolicy.h"
-#include "bindings/core/v8/ScriptCallStack.h"
#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/SourceLocation.h"
#include "core/dom/DOMStringList.h"
#include "core/dom/Document.h"
#include "core/dom/SandboxFlags.h"
@@ -811,15 +811,12 @@ static void gatherSecurityPolicyViolationEventData(SecurityPolicyViolationEventI
if (!SecurityOrigin::isSecure(document->url()) && document->loader())
init.setStatusCode(document->loader()->response().httpStatusCode());
- RefPtr<ScriptCallStack> stack = ScriptCallStack::capture(1);
- if (!stack || stack->isEmpty())
- return;
-
- if (stack->topLineNumber()) {
- KURL source = KURL(ParsedURLString, stack->topSourceURL());
+ OwnPtr<SourceLocation> location = SourceLocation::capture(document);
+ if (location->lineNumber()) {
+ KURL source = KURL(ParsedURLString, location->url());
init.setSourceFile(stripURLForUseInReport(document, source));
- init.setLineNumber(stack->topLineNumber());
- init.setColumnNumber(stack->topColumnNumber());
+ init.setLineNumber(location->lineNumber());
+ init.setColumnNumber(location->columnNumber());
}
}

Powered by Google App Engine
This is Rietveld 408576698