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

Side by Side Diff: third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of the XSL implementation. 2 * This file is part of the XSL implementation.
3 * 3 *
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved.
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 switch (type) { 96 switch (type) {
97 case XSLT_LOAD_DOCUMENT: { 97 case XSLT_LOAD_DOCUMENT: {
98 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; 98 xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt;
99 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); 99 xmlChar* base = xmlNodeGetBase(context->document->doc, context->node);
100 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei nterpret_cast<const char*>(uri)); 100 KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), rei nterpret_cast<const char*>(uri));
101 xmlFree(base); 101 xmlFree(base);
102 102
103 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio ns()); 103 ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptio ns());
104 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, fetchOptions); 104 FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, fetchOptions);
105 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin); 105 request.setOriginRestriction(FetchRequest::RestrictToSameOrigin);
106 ResourcePtr<Resource> resource = RawResource::fetchSynchronously(request , globalResourceFetcher); 106 RefPtrWillBeRawPtr<Resource> resource = RawResource::fetchSynchronously( request, globalResourceFetcher);
107 if (!resource || !globalProcessor) 107 if (!resource || !globalProcessor)
108 return nullptr; 108 return nullptr;
109 109
110 FrameConsole* console = nullptr; 110 FrameConsole* console = nullptr;
111 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f rame(); 111 LocalFrame* frame = globalProcessor->xslStylesheet()->ownerDocument()->f rame();
112 if (frame) 112 if (frame)
113 console = &frame->console(); 113 console = &frame->console();
114 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); 114 xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
115 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); 115 xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);
116 116
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 sheet->method = origMethod; 354 sheet->method = origMethod;
355 setXSLTLoadCallBack(0, 0, 0); 355 setXSLTLoadCallBack(0, 0, 0);
356 xsltFreeStylesheet(sheet); 356 xsltFreeStylesheet(sheet);
357 m_stylesheet = nullptr; 357 m_stylesheet = nullptr;
358 358
359 return success; 359 return success;
360 } 360 }
361 361
362 } // namespace blink 362 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/XSLImportRule.cpp ('k') | third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698