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

Side by Side Diff: Source/core/dom/ScriptLoader.cpp

Issue 1126343003: Ignore unknown options to subresource integrity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed option parsing + nits from mkwst Created 5 years, 7 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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 // Why are we ever attempting to execute scripts without a frame? 361 // Why are we ever attempting to execute scripts without a frame?
362 if (!frame) 362 if (!frame)
363 return true; 363 return true;
364 364
365 AccessControlStatus corsCheck = NotSharableCrossOrigin; 365 AccessControlStatus corsCheck = NotSharableCrossOrigin;
366 if (!m_isExternalScript || (sourceCode.resource() && sourceCode.resource()-> passesAccessControlCheck(m_element->document().securityOrigin()))) 366 if (!m_isExternalScript || (sourceCode.resource() && sourceCode.resource()-> passesAccessControlCheck(m_element->document().securityOrigin())))
367 corsCheck = SharableCrossOrigin; 367 corsCheck = SharableCrossOrigin;
368 368
369 if (m_isExternalScript) { 369 if (m_isExternalScript) {
370 const KURL resourceUrl = sourceCode.resource()->resourceRequest().url(); 370 const KURL resourceUrl = sourceCode.resource()->resourceRequest().url();
371 if (!SubresourceIntegrity::CheckSubresourceIntegrity(*m_element, sourceC ode.source(), sourceCode.resource()->url(), sourceCode.resource()->mimeType(), * sourceCode.resource())) { 371 if (!SubresourceIntegrity::CheckSubresourceIntegrity(*m_element, sourceC ode.source(), sourceCode.resource()->url(), *sourceCode.resource())) {
372 return false; 372 return false;
373 } 373 }
374 } 374 }
375 375
376 const bool isImportedScript = contextDocument != elementDocument; 376 const bool isImportedScript = contextDocument != elementDocument;
377 // http://www.whatwg.org/specs/web-apps/current-work/#execute-the-script-blo ck step 2.3 377 // http://www.whatwg.org/specs/web-apps/current-work/#execute-the-script-blo ck step 2.3
378 // with additional support for HTML imports. 378 // with additional support for HTML imports.
379 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncremente r(m_isExternalScript || isImportedScript ? contextDocument.get() : 0); 379 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncremente r(m_isExternalScript || isImportedScript ? contextDocument.get() : 0);
380 380
381 if (isHTMLScriptLoader(m_element)) 381 if (isHTMLScriptLoader(m_element))
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (isHTMLScriptLoader(element)) 486 if (isHTMLScriptLoader(element))
487 return toHTMLScriptElement(element)->loader(); 487 return toHTMLScriptElement(element)->loader();
488 488
489 if (isSVGScriptLoader(element)) 489 if (isSVGScriptLoader(element))
490 return toSVGScriptElement(element)->loader(); 490 return toSVGScriptElement(element)->loader();
491 491
492 return 0; 492 return 0;
493 } 493 }
494 494
495 } // namespace blink 495 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698