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

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

Issue 2218533002: Backporting JSONValues from protocol::Values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch back to partition allocator 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/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 743d7bfc50d2641ccddaaf824f50b512abda3114..2df252450035ef6b9a2f5743622acb5fed441688 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -878,7 +878,7 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
// sent explicitly. As for which directive was violated, that's pretty
// harmless information.
- RefPtr<JSONObject> cspReport = JSONObject::create();
+ std::unique_ptr<JSONObject> cspReport = JSONObject::create();
cspReport->setString("document-uri", violationData.documentURI());
cspReport->setString("referrer", violationData.referrer());
cspReport->setString("violated-directive", violationData.violatedDirective());
@@ -886,15 +886,15 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
cspReport->setString("original-policy", violationData.originalPolicy());
cspReport->setString("blocked-uri", violationData.blockedURI());
if (violationData.lineNumber())
- cspReport->setNumber("line-number", violationData.lineNumber());
+ cspReport->setInteger("line-number", violationData.lineNumber());
if (violationData.columnNumber())
- cspReport->setNumber("column-number", violationData.columnNumber());
+ cspReport->setInteger("column-number", violationData.columnNumber());
if (!violationData.sourceFile().isEmpty())
cspReport->setString("source-file", violationData.sourceFile());
- cspReport->setNumber("status-code", violationData.statusCode());
+ cspReport->setInteger("status-code", violationData.statusCode());
- RefPtr<JSONObject> reportObject = JSONObject::create();
- reportObject->setObject("csp-report", cspReport.release());
+ std::unique_ptr<JSONObject> reportObject = JSONObject::create();
+ reportObject->setObject("csp-report", std::move(cspReport));
String stringifiedReport = reportObject->toJSONString();
if (!shouldSendViolationReport(stringifiedReport))
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698