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/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/css/StyleSheetContents.h" | 8 #include "core/css/StyleSheetContents.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 params.SetCrossOriginAccessControl(GetDocument().GetSecurityOrigin(), | 345 params.SetCrossOriginAccessControl(GetDocument().GetSecurityOrigin(), |
346 cross_origin); | 346 cross_origin); |
347 SetFetchFollowingCORS(); | 347 SetFetchFollowingCORS(); |
348 } | 348 } |
349 | 349 |
350 String integrity_attr = owner_->FastGetAttribute(integrityAttr); | 350 String integrity_attr = owner_->FastGetAttribute(integrityAttr); |
351 if (!integrity_attr.IsEmpty()) { | 351 if (!integrity_attr.IsEmpty()) { |
352 IntegrityMetadataSet metadata_set; | 352 IntegrityMetadataSet metadata_set; |
353 SubresourceIntegrity::ParseIntegrityAttribute(integrity_attr, metadata_set); | 353 SubresourceIntegrity::ParseIntegrityAttribute(integrity_attr, metadata_set); |
354 params.SetIntegrityMetadata(metadata_set); | 354 params.SetIntegrityMetadata(metadata_set); |
| 355 params.SetIntegrityValue(integrity_attr); |
355 } | 356 } |
356 SetResource(CSSStyleSheetResource::Fetch(params, GetDocument().Fetcher())); | 357 SetResource(CSSStyleSheetResource::Fetch(params, GetDocument().Fetcher())); |
357 | 358 |
358 if (loading_ && !GetResource()) { | 359 if (loading_ && !GetResource()) { |
359 // The request may have been denied if (for example) the stylesheet is | 360 // The request may have been denied if (for example) the stylesheet is |
360 // local and the document is remote, or if there was a Content Security | 361 // local and the document is remote, or if there was a Content Security |
361 // Policy Failure. setCSSStyleSheet() can be called synchronuosly in | 362 // Policy Failure. setCSSStyleSheet() can be called synchronuosly in |
362 // setResource() and thus resource() is null and |m_loading| is false in | 363 // setResource() and thus resource() is null and |m_loading| is false in |
363 // such cases even if the request succeeds. | 364 // such cases even if the request succeeds. |
364 loading_ = false; | 365 loading_ = false; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 ClearSheet(); | 428 ClearSheet(); |
428 } | 429 } |
429 | 430 |
430 DEFINE_TRACE(LinkStyle) { | 431 DEFINE_TRACE(LinkStyle) { |
431 visitor->Trace(sheet_); | 432 visitor->Trace(sheet_); |
432 LinkResource::Trace(visitor); | 433 LinkResource::Trace(visitor); |
433 ResourceOwner<StyleSheetResource>::Trace(visitor); | 434 ResourceOwner<StyleSheetResource>::Trace(visitor); |
434 } | 435 } |
435 | 436 |
436 } // namespace blink | 437 } // namespace blink |
OLD | NEW |