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

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

Issue 2585283002: Migrate WTF::Vector::append() to ::push_back() [part 6 of N] (Closed)
Patch Set: Created 4 years 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/SourceListDirective.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
index 6d57492a6afca2a9ba460de89119dec20bfc3e50..058f5aaaeff93b743b7214770d2e37e350a9600f 100644
--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
@@ -150,8 +150,8 @@ void SourceListDirective::parse(const UChar* begin, const UChar* end) {
if (ContentSecurityPolicy::getDirectiveType(host) !=
ContentSecurityPolicy::DirectiveType::Undefined)
m_policy->reportDirectiveAsSourceExpression(m_directiveName, host);
- m_list.append(new CSPSource(m_policy, scheme, host, port, path,
- hostWildcard, portWildcard));
+ m_list.push_back(new CSPSource(m_policy, scheme, host, port, path,
+ hostWildcard, portWildcard));
} else {
m_policy->reportInvalidSourceExpression(
m_directiveName, String(beginSource, position - beginSource));
@@ -603,19 +603,22 @@ HeapVector<Member<CSPSource>> SourceListDirective::getSources(
Member<CSPSource> self) const {
HeapVector<Member<CSPSource>> sources = m_list;
if (m_allowStar) {
- sources.append(new CSPSource(m_policy, "ftp", String(), 0, String(),
- CSPSource::NoWildcard, CSPSource::NoWildcard));
- sources.append(new CSPSource(m_policy, "ws", String(), 0, String(),
- CSPSource::NoWildcard, CSPSource::NoWildcard));
- sources.append(new CSPSource(m_policy, "http", String(), 0, String(),
- CSPSource::NoWildcard, CSPSource::NoWildcard));
+ sources.push_back(new CSPSource(m_policy, "ftp", String(), 0, String(),
+ CSPSource::NoWildcard,
+ CSPSource::NoWildcard));
+ sources.push_back(new CSPSource(m_policy, "ws", String(), 0, String(),
+ CSPSource::NoWildcard,
+ CSPSource::NoWildcard));
+ sources.push_back(new CSPSource(m_policy, "http", String(), 0, String(),
+ CSPSource::NoWildcard,
+ CSPSource::NoWildcard));
if (self) {
- sources.append(new CSPSource(m_policy, self->getScheme(), String(), 0,
- String(), CSPSource::NoWildcard,
- CSPSource::NoWildcard));
+ sources.push_back(new CSPSource(m_policy, self->getScheme(), String(), 0,
+ String(), CSPSource::NoWildcard,
+ CSPSource::NoWildcard));
}
} else if (m_allowSelf && self) {
- sources.append(self);
+ sources.push_back(self);
}
return sources;
@@ -764,7 +767,7 @@ HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources(
// We do not add secure versions if insecure schemes are present.
if ((it.key != "https" || !schemesMap.contains("http")) &&
(it.key != "wss" || !schemesMap.contains("ws"))) {
- normalized.append(it.value);
+ normalized.push_back(it.value);
}
}
@@ -784,7 +787,7 @@ HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources(
// `other` list, we add all the sourceB with that scheme.
if (sourceA->isSchemeOnly()) {
if (CSPSource* localMatch = sourceB->intersect(sourceA))
- normalized.append(localMatch);
+ normalized.push_back(localMatch);
continue;
}
if (sourceB->subsumes(sourceA)) {
@@ -795,7 +798,7 @@ HeapVector<Member<CSPSource>> SourceListDirective::getIntersectCSPSources(
match = localMatch;
}
if (match)
- normalized.append(match);
+ normalized.push_back(match);
}
return normalized;
}

Powered by Google App Engine
This is Rietveld 408576698