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

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

Issue 1279163005: Initial Fetch integration for Subresource Integrity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test expectations Created 5 years, 4 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/SubresourceIntegrity.cpp ('k') | Source/modules/fetch/FetchManager.cpp » ('j') | 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 return m_owner->document(); 503 return m_owner->document();
504 } 504 }
505 505
506 void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource* cachedStyleSheet) 506 void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource* cachedStyleSheet)
507 { 507 {
508 if (!m_owner->inDocument()) { 508 if (!m_owner->inDocument()) {
509 ASSERT(!m_sheet); 509 ASSERT(!m_sheet);
510 return; 510 return;
511 } 511 }
512 512
513 // See the comment in ScriptLoader.cpp about why this check is necessary
514 // here. https://crbug.com/500701.
513 if (!cachedStyleSheet->errorOccurred() && !SubresourceIntegrity::CheckSubres ourceIntegrity(*m_owner, cachedStyleSheet->sheetText(), KURL(baseURL, href), *ca chedStyleSheet)) { 515 if (!cachedStyleSheet->errorOccurred() && !SubresourceIntegrity::CheckSubres ourceIntegrity(*m_owner, cachedStyleSheet->sheetText(), KURL(baseURL, href), *ca chedStyleSheet)) {
514 m_loading = false; 516 m_loading = false;
515 removePendingSheet(); 517 removePendingSheet();
516 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSu bresource); 518 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSu bresource);
517 return; 519 return;
518 } 520 }
519 521
520 // Completing the sheet load may cause scripts to execute. 522 // Completing the sheet load may cause scripts to execute.
521 RefPtrWillBeRawPtr<Node> protector(m_owner.get()); 523 RefPtrWillBeRawPtr<Node> protector(m_owner.get());
522 524
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 removePendingSheet(); 770 removePendingSheet();
769 } 771 }
770 772
771 DEFINE_TRACE(LinkStyle) 773 DEFINE_TRACE(LinkStyle)
772 { 774 {
773 visitor->trace(m_sheet); 775 visitor->trace(m_sheet);
774 LinkResource::trace(visitor); 776 LinkResource::trace(visitor);
775 } 777 }
776 778
777 } // namespace blink 779 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | Source/modules/fetch/FetchManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698