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

Unified Diff: third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp

Issue 1409113010: Oilpan: Remove Partitions::fastStrDup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/Partitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp b/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
index cad57f3e6a4518bec763a1452df2cbe3e91623c7..4507fb1c96d92c4772c42379c97113a9381578c4 100644
--- a/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
+++ b/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
@@ -189,6 +189,14 @@ static bool saveResultToString(xmlDocPtr resultDoc, xsltStylesheetPtr sheet, Str
return true;
}
+static char* allocateParameterArray(const char* data)
+{
+ size_t length = strlen(data) + 1;
+ char* parameterArray = static_cast<char*>(WTF::Partitions::fastMalloc(length));
+ memcpy(parameterArray, data, length);
+ return parameterArray;
+}
+
static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& parameters)
{
if (parameters.isEmpty())
@@ -198,8 +206,8 @@ static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap&
unsigned index = 0;
for (auto& parameter : parameters) {
- parameterArray[index++] = WTF::Partitions::fastStrDup(parameter.key.utf8().data());
- parameterArray[index++] = WTF::Partitions::fastStrDup(parameter.value.utf8().data());
+ parameterArray[index++] = allocateParameterArray(parameter.key.utf8().data());
+ parameterArray[index++] = allocateParameterArray(parameter.value.utf8().data());
}
parameterArray[index] = 0;
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/Partitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698