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

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

Issue 2919653004: Use LOG() or LOG_IF() instead of IMMEDIATE_CRASH (Closed)
Patch Set: Use LOG() or CHECK()|CHECK_FOO() instead of IMMEDIATE_CRASH Created 3 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 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // and it's not needed even for documents, as the result of this 337 // and it's not needed even for documents, as the result of this
338 // function is always immediately parsed. 338 // function is always immediately parsed.
339 sheet->omitXmlDeclaration = true; 339 sheet->omitXmlDeclaration = true;
340 340
341 xsltTransformContextPtr transform_context = 341 xsltTransformContextPtr transform_context =
342 xsltNewTransformContext(sheet, source_doc); 342 xsltNewTransformContext(sheet, source_doc);
343 RegisterXSLTExtensions(transform_context); 343 RegisterXSLTExtensions(transform_context);
344 344
345 xsltSecurityPrefsPtr security_prefs = xsltNewSecurityPrefs(); 345 xsltSecurityPrefsPtr security_prefs = xsltNewSecurityPrefs();
346 // Read permissions are checked by docLoaderFunc. 346 // Read permissions are checked by docLoaderFunc.
347 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_FILE, 347 CHECK_EQ(0, xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_FILE,
348 xsltSecurityForbid)) 348 xsltSecurityForbid));
349 IMMEDIATE_CRASH(); 349 CHECK_EQ(0,
350 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_CREATE_DIRECTORY, 350 xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_CREATE_DIRECTORY,
351 xsltSecurityForbid)) 351 xsltSecurityForbid));
352 IMMEDIATE_CRASH(); 352 CHECK_EQ(0, xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_NETWORK,
353 if (0 != xsltSetSecurityPrefs(security_prefs, XSLT_SECPREF_WRITE_NETWORK, 353 xsltSecurityForbid));
354 xsltSecurityForbid)) 354 CHECK_EQ(0, xsltSetCtxtSecurityPrefs(security_prefs, transform_context));
355 IMMEDIATE_CRASH();
356 if (0 != xsltSetCtxtSecurityPrefs(security_prefs, transform_context))
357 IMMEDIATE_CRASH();
358 355
359 // <http://bugs.webkit.org/show_bug.cgi?id=16077>: XSLT processor 356 // <http://bugs.webkit.org/show_bug.cgi?id=16077>: XSLT processor
360 // <xsl:sort> algorithm only compares by code point. 357 // <xsl:sort> algorithm only compares by code point.
361 xsltSetCtxtSortFunc(transform_context, XsltUnicodeSortFunction); 358 xsltSetCtxtSortFunc(transform_context, XsltUnicodeSortFunction);
362 359
363 // This is a workaround for a bug in libxslt. 360 // This is a workaround for a bug in libxslt.
364 // The bug has been fixed in version 1.1.13, so once we ship that this 361 // The bug has been fixed in version 1.1.13, so once we ship that this
365 // can be removed. 362 // can be removed.
366 if (!transform_context->globalVars) 363 if (!transform_context->globalVars)
367 transform_context->globalVars = xmlHashCreate(20); 364 transform_context->globalVars = xmlHashCreate(20);
(...skipping 20 matching lines...) Expand all
388 385
389 sheet->method = orig_method; 386 sheet->method = orig_method;
390 SetXSLTLoadCallBack(0, 0, 0); 387 SetXSLTLoadCallBack(0, 0, 0);
391 xsltFreeStylesheet(sheet); 388 xsltFreeStylesheet(sheet);
392 stylesheet_ = nullptr; 389 stylesheet_ = nullptr;
393 390
394 return success; 391 return success;
395 } 392 }
396 393
397 } // namespace blink 394 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.cpp ('k') | third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698