OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/LinkStyle.h" | 5 #include "core/html/LinkStyle.h" |
6 | 6 |
7 #include "core/css/StyleSheetContents.h" | 7 #include "core/css/StyleSheetContents.h" |
8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "core/frame/SubresourceIntegrity.h" | 9 #include "core/frame/SubresourceIntegrity.h" |
10 #include "core/frame/csp/ContentSecurityPolicy.h" | 10 #include "core/frame/csp/ContentSecurityPolicy.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 if (disposition == ResourceIntegrityDisposition::Failed) { | 101 if (disposition == ResourceIntegrityDisposition::Failed) { |
102 m_loading = false; | 102 m_loading = false; |
103 removePendingSheet(); | 103 removePendingSheet(); |
104 notifyLoadedSheetAndAllCriticalSubresources( | 104 notifyLoadedSheetAndAllCriticalSubresources( |
105 Node::ErrorOccurredLoadingSubresource); | 105 Node::ErrorOccurredLoadingSubresource); |
106 return; | 106 return; |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 CSSParserContext parserContext(m_owner->document(), nullptr, baseURL, | 110 CSSParserContext* parserContext = |
111 charset); | 111 new CSSParserContext(m_owner->document(), baseURL, charset); |
112 | 112 |
113 DEFINE_STATIC_LOCAL(EnumerationHistogram, restoredCachedStyleSheetHistogram, | 113 DEFINE_STATIC_LOCAL(EnumerationHistogram, restoredCachedStyleSheetHistogram, |
114 ("Blink.RestoredCachedStyleSheet", 2)); | 114 ("Blink.RestoredCachedStyleSheet", 2)); |
115 DEFINE_STATIC_LOCAL( | 115 DEFINE_STATIC_LOCAL( |
116 EnumerationHistogram, restoredCachedStyleSheet2Histogram, | 116 EnumerationHistogram, restoredCachedStyleSheet2Histogram, |
117 ("Blink.RestoredCachedStyleSheet2", StyleSheetCacheStatusCount)); | 117 ("Blink.RestoredCachedStyleSheet2", StyleSheetCacheStatusCount)); |
118 | 118 |
119 if (StyleSheetContents* restoredSheet = | 119 if (StyleSheetContents* restoredSheet = |
120 const_cast<CSSStyleSheetResource*>(cachedStyleSheet) | 120 const_cast<CSSStyleSheetResource*>(cachedStyleSheet) |
121 ->restoreParsedStyleSheet(parserContext)) { | 121 ->restoreParsedStyleSheet(parserContext)) { |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 removePendingSheet(); | 415 removePendingSheet(); |
416 } | 416 } |
417 | 417 |
418 DEFINE_TRACE(LinkStyle) { | 418 DEFINE_TRACE(LinkStyle) { |
419 visitor->trace(m_sheet); | 419 visitor->trace(m_sheet); |
420 LinkResource::trace(visitor); | 420 LinkResource::trace(visitor); |
421 ResourceOwner<StyleSheetResource>::trace(visitor); | 421 ResourceOwner<StyleSheetResource>::trace(visitor); |
422 } | 422 } |
423 | 423 |
424 } // namespace blink | 424 } // namespace blink |
OLD | NEW |