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

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

Issue 2204383003: Make blink::JSONValue (and subclasses) use unique_ptr rather than RefPtrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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..d2bc897e4876d6797494a39935d1c0796c745b0d 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());
@@ -893,8 +893,8 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
cspReport->setString("source-file", violationData.sourceFile());
cspReport->setNumber("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))

Powered by Google App Engine
This is Rietveld 408576698