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

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

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 bool blocking = mediaQueryMatches && !m_owner->isAlternate(); 728 bool blocking = mediaQueryMatches && !m_owner->isAlternate();
729 addPendingSheet(blocking ? Blocking : NonBlocking); 729 addPendingSheet(blocking ? Blocking : NonBlocking);
730 730
731 // Load stylesheets that are not needed for the layout immediately with low priority. 731 // Load stylesheets that are not needed for the layout immediately with low priority.
732 FetchRequest request = builder.build(blocking); 732 FetchRequest request = builder.build(blocking);
733 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros soriginAttr); 733 AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::cros soriginAttr);
734 if (!crossOriginMode.isNull()) { 734 if (!crossOriginMode.isNull()) {
735 request.setCrossOriginAccessControl(document().securityOrigin(), cro ssOriginMode); 735 request.setCrossOriginAccessControl(document().securityOrigin(), cro ssOriginMode);
736 setFetchFollowingCORS(); 736 setFetchFollowingCORS();
737 } 737 }
738 setResource(document().fetcher()->fetchCSSStyleSheet(request)); 738 setResource(CSSStyleSheetResource::fetch(request, document().fetcher())) ;
739 739
740 if (!resource()) { 740 if (!resource()) {
741 // The request may have been denied if (for example) the stylesheet is local and the document is remote, or if there was a Content Security Policy F ailure. 741 // The request may have been denied if (for example) the stylesheet is local and the document is remote, or if there was a Content Security Policy F ailure.
742 m_loading = false; 742 m_loading = false;
743 removePendingSheet(); 743 removePendingSheet();
744 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadi ngSubresource); 744 notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadi ngSubresource);
745 } 745 }
746 } else if (m_sheet) { 746 } else if (m_sheet) {
747 // we no longer contain a stylesheet, e.g. perhaps rel or type was chang ed 747 // we no longer contain a stylesheet, e.g. perhaps rel or type was chang ed
748 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet.get(); 748 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet.get();
(...skipping 17 matching lines...) Expand all
766 removePendingSheet(); 766 removePendingSheet();
767 } 767 }
768 768
769 DEFINE_TRACE(LinkStyle) 769 DEFINE_TRACE(LinkStyle)
770 { 770 {
771 visitor->trace(m_sheet); 771 visitor->trace(m_sheet);
772 LinkResource::trace(visitor); 772 LinkResource::trace(visitor);
773 } 773 }
774 774
775 } // namespace blink 775 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698