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

Side by Side Diff: third_party/WebKit/Source/core/html/LinkStyle.cpp

Issue 2941883003: [ServiceWorker] Fetch event should return integrity value (Closed)
Patch Set: Rebase Created 3 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
OLDNEW
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 params.SetCrossOriginAccessControl(GetDocument().GetSecurityOrigin(), 346 params.SetCrossOriginAccessControl(GetDocument().GetSecurityOrigin(),
347 cross_origin); 347 cross_origin);
348 SetFetchFollowingCORS(); 348 SetFetchFollowingCORS();
349 } 349 }
350 350
351 String integrity_attr = owner_->FastGetAttribute(integrityAttr); 351 String integrity_attr = owner_->FastGetAttribute(integrityAttr);
352 if (!integrity_attr.IsEmpty()) { 352 if (!integrity_attr.IsEmpty()) {
353 IntegrityMetadataSet metadata_set; 353 IntegrityMetadataSet metadata_set;
354 SubresourceIntegrity::ParseIntegrityAttribute(integrity_attr, metadata_set); 354 SubresourceIntegrity::ParseIntegrityAttribute(integrity_attr, metadata_set);
355 params.SetIntegrityMetadata(metadata_set); 355 params.SetIntegrityMetadata(metadata_set);
356 params.SetIntegrityValue(integrity_attr);
356 } 357 }
357 SetResource(CSSStyleSheetResource::Fetch(params, GetDocument().Fetcher())); 358 SetResource(CSSStyleSheetResource::Fetch(params, GetDocument().Fetcher()));
358 359
359 if (loading_ && !GetResource()) { 360 if (loading_ && !GetResource()) {
360 // The request may have been denied if (for example) the stylesheet is 361 // The request may have been denied if (for example) the stylesheet is
361 // local and the document is remote, or if there was a Content Security 362 // local and the document is remote, or if there was a Content Security
362 // Policy Failure. setCSSStyleSheet() can be called synchronuosly in 363 // Policy Failure. setCSSStyleSheet() can be called synchronuosly in
363 // setResource() and thus resource() is null and |m_loading| is false in 364 // setResource() and thus resource() is null and |m_loading| is false in
364 // such cases even if the request succeeds. 365 // such cases even if the request succeeds.
365 loading_ = false; 366 loading_ = false;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 ClearSheet(); 429 ClearSheet();
429 } 430 }
430 431
431 DEFINE_TRACE(LinkStyle) { 432 DEFINE_TRACE(LinkStyle) {
432 visitor->Trace(sheet_); 433 visitor->Trace(sheet_);
433 LinkResource::Trace(visitor); 434 LinkResource::Trace(visitor);
434 ResourceOwner<StyleSheetResource>::Trace(visitor); 435 ResourceOwner<StyleSheetResource>::Trace(visitor);
435 } 436 }
436 437
437 } // namespace blink 438 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698