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

Side by Side Diff: Source/core/loader/FrameFetchContext.cpp

Issue 1141883003: Enable `as` based priorities for <link rel=preload> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments Created 5 years, 7 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/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/LinkLoader.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // any URL. 350 // any URL.
351 switch (type) { 351 switch (type) {
352 case Resource::MainResource: 352 case Resource::MainResource:
353 case Resource::Image: 353 case Resource::Image:
354 case Resource::CSSStyleSheet: 354 case Resource::CSSStyleSheet:
355 case Resource::Script: 355 case Resource::Script:
356 case Resource::Font: 356 case Resource::Font:
357 case Resource::Raw: 357 case Resource::Raw:
358 case Resource::LinkPrefetch: 358 case Resource::LinkPrefetch:
359 case Resource::LinkSubresource: 359 case Resource::LinkSubresource:
360 case Resource::LinkPreload:
360 case Resource::TextTrack: 361 case Resource::TextTrack:
361 case Resource::ImportResource: 362 case Resource::ImportResource:
362 case Resource::Media: 363 case Resource::Media:
363 // By default these types of resources can be loaded from any origin. 364 // By default these types of resources can be loaded from any origin.
364 // FIXME: Are we sure about Resource::Font? 365 // FIXME: Are we sure about Resource::Font?
365 if (originRestriction == FetchRequest::RestrictToSameOrigin && !security Origin->canRequest(url)) { 366 if (originRestriction == FetchRequest::RestrictToSameOrigin && !security Origin->canRequest(url)) {
366 printAccessDeniedMessage(url); 367 printAccessDeniedMessage(url);
367 return false; 368 return false;
368 } 369 }
369 break; 370 break;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 case Resource::Font: { 429 case Resource::Font: {
429 ASSERT(ContentSecurityPolicy::isFontResource(resourceRequest)); 430 ASSERT(ContentSecurityPolicy::isFontResource(resourceRequest));
430 if (!shouldBypassMainWorldCSP && !csp->allowFontFromSource(url, redirect Status, cspReporting)) 431 if (!shouldBypassMainWorldCSP && !csp->allowFontFromSource(url, redirect Status, cspReporting))
431 return false; 432 return false;
432 break; 433 break;
433 } 434 }
434 case Resource::MainResource: 435 case Resource::MainResource:
435 case Resource::Raw: 436 case Resource::Raw:
436 case Resource::LinkPrefetch: 437 case Resource::LinkPrefetch:
437 case Resource::LinkSubresource: 438 case Resource::LinkSubresource:
439 case Resource::LinkPreload:
438 break; 440 break;
439 case Resource::Media: 441 case Resource::Media:
440 case Resource::TextTrack: 442 case Resource::TextTrack:
441 ASSERT(ContentSecurityPolicy::isMediaResource(resourceRequest)); 443 ASSERT(ContentSecurityPolicy::isMediaResource(resourceRequest));
442 if (!shouldBypassMainWorldCSP && !csp->allowMediaFromSource(url, redirec tStatus, cspReporting)) 444 if (!shouldBypassMainWorldCSP && !csp->allowMediaFromSource(url, redirec tStatus, cspReporting))
443 return false; 445 return false;
444 446
445 if (!frame()->loader().client()->allowMedia(url)) 447 if (!frame()->loader().client()->allowMedia(url))
446 return false; 448 return false;
447 break; 449 break;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" ); 641 fetchRequest.mutableResourceRequest().addHTTPHeaderField("CSP", "active" );
640 } 642 }
641 643
642 DEFINE_TRACE(FrameFetchContext) 644 DEFINE_TRACE(FrameFetchContext)
643 { 645 {
644 visitor->trace(m_document); 646 visitor->trace(m_document);
645 FetchContext::trace(visitor); 647 FetchContext::trace(visitor);
646 } 648 }
647 649
648 } // namespace blink 650 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/LinkLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698