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

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

Issue 1161323007: Use nullptr instead of 0 in xml and xmlhttprequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comment & modified in other files which assigned "0" to ptr. Created 5 years, 6 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 | « Source/core/xml/XSLStyleSheetLibxslt.cpp ('k') | Source/core/xml/XSLTUnicodeSort.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XSLTProcessorLibxslt.cpp
diff --git a/Source/core/xml/XSLTProcessorLibxslt.cpp b/Source/core/xml/XSLTProcessorLibxslt.cpp
index fb2e286a9c8afd0c90315bee9ceaf02ecd71ea3f..b8979141e7089e1ca59fdd8f7771b9e1492695e6 100644
--- a/Source/core/xml/XSLTProcessorLibxslt.cpp
+++ b/Source/core/xml/XSLTProcessorLibxslt.cpp
@@ -83,14 +83,14 @@ void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
}
// FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals.
-static XSLTProcessor* globalProcessor = 0;
-static ResourceFetcher* globalResourceFetcher = 0;
+static XSLTProcessor* globalProcessor = nullptr;
+static ResourceFetcher* globalResourceFetcher = nullptr;
static xmlDocPtr docLoaderFunc(
const xmlChar* uri, xmlDictPtr, int options, void* ctxt, xsltLoadType type)
{
if (!globalProcessor)
- return 0;
+ return nullptr;
switch (type) {
case XSLT_LOAD_DOCUMENT: {
@@ -104,9 +104,9 @@ static xmlDocPtr docLoaderFunc(
request.setOriginRestriction(FetchRequest::RestrictToSameOrigin);
ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronously(request);
if (!resource || !globalProcessor)
- return 0;
+ return nullptr;
- FrameConsole* console = 0;
+ FrameConsole* console = nullptr;
LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame();
if (frame)
console = &frame->console();
@@ -116,7 +116,7 @@ static xmlDocPtr docLoaderFunc(
// We don't specify an encoding here. Neither Gecko nor WinIE respects
// the encoding specified in the HTTP headers.
SharedBuffer* data = resource->resourceBuffer();
- xmlDocPtr doc = data ? xmlReadMemory(data->data(), data->size(), (const char*)uri, 0, options) : 0;
+ xmlDocPtr doc = data ? xmlReadMemory(data->data(), data->size(), (const char*)uri, 0, options) : nullptr;
xmlSetStructuredErrorFunc(0, 0);
xmlSetGenericErrorFunc(0, 0);
@@ -129,7 +129,7 @@ static xmlDocPtr docLoaderFunc(
break;
}
- return 0;
+ return nullptr;
}
static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, ResourceFetcher* fetcher)
@@ -190,7 +190,7 @@ static bool saveResultToString(xmlDocPtr resultDoc, xsltStylesheetPtr sheet, Str
static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& parameters)
{
if (parameters.isEmpty())
- return 0;
+ return nullptr;
const char** parameterArray = static_cast<const char**>(fastMalloc(((parameters.size() * 2) + 1) * sizeof(char*)));
@@ -234,7 +234,7 @@ static xsltStylesheetPtr xsltStylesheetPointer(Document* document, RefPtrWillBeM
}
if (!cachedStylesheet || !cachedStylesheet->document())
- return 0;
+ return nullptr;
return cachedStylesheet->compileStyleSheet();
}
@@ -244,7 +244,7 @@ static inline xmlDocPtr xmlDocPtrFromNode(Node* sourceNode, bool& shouldDelete)
RefPtrWillBeRawPtr<Document> ownerDocument(sourceNode->document());
bool sourceIsDocument = (sourceNode == ownerDocument.get());
- xmlDocPtr sourceDoc = 0;
+ xmlDocPtr sourceDoc = nullptr;
if (sourceIsDocument && ownerDocument->transformSource())
sourceDoc = (xmlDocPtr)ownerDocument->transformSource()->platformSource();
if (!sourceDoc) {
@@ -261,7 +261,7 @@ static inline String resultMIMEType(xmlDocPtr resultDoc, xsltStylesheetPtr sheet
// HTML (create an HTML document), XML (create an XML document),
// and text (wrap in a <pre> and create an XML document).
- const xmlChar* resultType = 0;
+ const xmlChar* resultType = nullptr;
XSLT_GET_IMPORT_PTR(resultType, sheet, method);
if (!resultType && resultDoc->type == XML_HTML_DOCUMENT_NODE)
resultType = (const xmlChar*)"html";
« no previous file with comments | « Source/core/xml/XSLStyleSheetLibxslt.cpp ('k') | Source/core/xml/XSLTUnicodeSort.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698