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

Side by Side Diff: Source/core/html/HTMLLinkElement.cpp

Issue 954233003: Enable SRI only for same origin and CORS content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test failures Created 5 years, 9 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
« no previous file with comments | « Source/core/frame/SubresourceIntegrityTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 return m_owner->document(); 502 return m_owner->document();
503 } 503 }
504 504
505 void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource* cachedStyleSheet) 505 void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource* cachedStyleSheet)
506 { 506 {
507 if (!m_owner->inDocument()) { 507 if (!m_owner->inDocument()) {
508 ASSERT(!m_sheet); 508 ASSERT(!m_sheet);
509 return; 509 return;
510 } 510 }
511 511
512 if (!SubresourceIntegrity::CheckSubresourceIntegrity(*m_owner, cachedStyleSh eet->sheetText(), KURL(KURL(), href), cachedStyleSheet->mimeType())) { 512 if (!cachedStyleSheet->errorOccurred() && !SubresourceIntegrity::CheckSubres ourceIntegrity(*m_owner, cachedStyleSheet->sheetText(), KURL(baseURL, href), cac hedStyleSheet->mimeType(), *cachedStyleSheet)) {
513 m_loading = false; 513 m_loading = false;
514 removePendingSheet(); 514 removePendingSheet();
515 notifyLoadedSheetAndAllCriticalSubresources(true); 515 notifyLoadedSheetAndAllCriticalSubresources(true);
516 return; 516 return;
517 } 517 }
518 518
519 // Completing the sheet load may cause scripts to execute. 519 // Completing the sheet load may cause scripts to execute.
520 RefPtrWillBeRawPtr<Node> protector(m_owner.get()); 520 RefPtrWillBeRawPtr<Node> protector(m_owner.get());
521 521
522 CSSParserContext parserContext(m_owner->document(), 0, baseURL, charset); 522 CSSParserContext parserContext(m_owner->document(), 0, baseURL, charset);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 removePendingSheet(); 752 removePendingSheet();
753 } 753 }
754 754
755 DEFINE_TRACE(LinkStyle) 755 DEFINE_TRACE(LinkStyle)
756 { 756 {
757 visitor->trace(m_sheet); 757 visitor->trace(m_sheet);
758 LinkResource::trace(visitor); 758 LinkResource::trace(visitor);
759 } 759 }
760 760
761 } // namespace blink 761 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/SubresourceIntegrityTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698