OLD | NEW |
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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 // any URL. | 425 // any URL. |
426 switch (type) { | 426 switch (type) { |
427 case Resource::MainResource: | 427 case Resource::MainResource: |
428 case Resource::Image: | 428 case Resource::Image: |
429 case Resource::CSSStyleSheet: | 429 case Resource::CSSStyleSheet: |
430 case Resource::Script: | 430 case Resource::Script: |
431 case Resource::Font: | 431 case Resource::Font: |
432 case Resource::Raw: | 432 case Resource::Raw: |
433 case Resource::LinkPrefetch: | 433 case Resource::LinkPrefetch: |
434 case Resource::LinkPreload: | 434 case Resource::LinkPreload: |
435 case Resource::LinkSubresource: | |
436 case Resource::TextTrack: | 435 case Resource::TextTrack: |
437 case Resource::ImportResource: | 436 case Resource::ImportResource: |
438 case Resource::Media: | 437 case Resource::Media: |
439 case Resource::Manifest: | 438 case Resource::Manifest: |
440 // By default these types of resources can be loaded from any origin. | 439 // By default these types of resources can be loaded from any origin. |
441 // FIXME: Are we sure about Resource::Font? | 440 // FIXME: Are we sure about Resource::Font? |
442 if (originRestriction == FetchRequest::RestrictToSameOrigin && !security
Origin->canRequest(url)) { | 441 if (originRestriction == FetchRequest::RestrictToSameOrigin && !security
Origin->canRequest(url)) { |
443 printAccessDeniedMessage(url); | 442 printAccessDeniedMessage(url); |
444 return ResourceRequestBlockedReasonOrigin; | 443 return ResourceRequestBlockedReasonOrigin; |
445 } | 444 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 break; | 509 break; |
511 } | 510 } |
512 case Resource::LinkPreload: | 511 case Resource::LinkPreload: |
513 ASSERT(csp); | 512 ASSERT(csp); |
514 if (!shouldBypassMainWorldCSP && !csp->allowConnectToSource(url, redirec
tStatus, cspReporting)) | 513 if (!shouldBypassMainWorldCSP && !csp->allowConnectToSource(url, redirec
tStatus, cspReporting)) |
515 return ResourceRequestBlockedReasonCSP; | 514 return ResourceRequestBlockedReasonCSP; |
516 break; | 515 break; |
517 case Resource::MainResource: | 516 case Resource::MainResource: |
518 case Resource::Raw: | 517 case Resource::Raw: |
519 case Resource::LinkPrefetch: | 518 case Resource::LinkPrefetch: |
520 case Resource::LinkSubresource: | |
521 case Resource::Manifest: | 519 case Resource::Manifest: |
522 break; | 520 break; |
523 case Resource::Media: | 521 case Resource::Media: |
524 case Resource::TextTrack: | 522 case Resource::TextTrack: |
525 ASSERT(ContentSecurityPolicy::isMediaResource(resourceRequest)); | 523 ASSERT(ContentSecurityPolicy::isMediaResource(resourceRequest)); |
526 ASSERT(csp); | 524 ASSERT(csp); |
527 if (!shouldBypassMainWorldCSP && !csp->allowMediaFromSource(url, redirec
tStatus, cspReporting)) | 525 if (!shouldBypassMainWorldCSP && !csp->allowMediaFromSource(url, redirec
tStatus, cspReporting)) |
528 return ResourceRequestBlockedReasonCSP; | 526 return ResourceRequestBlockedReasonCSP; |
529 | 527 |
530 if (!frame()->loader().client()->allowMedia(url)) | 528 if (!frame()->loader().client()->allowMedia(url)) |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 } | 790 } |
793 | 791 |
794 DEFINE_TRACE(FrameFetchContext) | 792 DEFINE_TRACE(FrameFetchContext) |
795 { | 793 { |
796 visitor->trace(m_document); | 794 visitor->trace(m_document); |
797 visitor->trace(m_documentLoader); | 795 visitor->trace(m_documentLoader); |
798 FetchContext::trace(visitor); | 796 FetchContext::trace(visitor); |
799 } | 797 } |
800 | 798 |
801 } // namespace blink | 799 } // namespace blink |
OLD | NEW |