Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 break; | 550 break; |
| 551 } | 551 } |
| 552 | 552 |
| 553 // SVG Images have unique security rules that prevent all subresource reques ts | 553 // SVG Images have unique security rules that prevent all subresource reques ts |
| 554 // except for data urls. | 554 // except for data urls. |
| 555 if (type != Resource::MainResource) { | 555 if (type != Resource::MainResource) { |
| 556 if (frame() && frame()->chromeClient().isSVGImageChromeClient() && !url. protocolIsData()) | 556 if (frame() && frame()->chromeClient().isSVGImageChromeClient() && !url. protocolIsData()) |
| 557 return false; | 557 return false; |
| 558 } | 558 } |
| 559 | 559 |
| 560 // FIXME(http://crbug.com/390497): Make sure that CSP uses RequestContext in stead of this terrible Resource::Type enum. | |
|
Mike West
2014/09/29 11:00:46
Nit: Can you change this to something like "FIXME:
| |
| 561 if (resourceRequest.requestContext() == WebURLRequest::RequestContextManifes t) { | |
| 562 if (!shouldBypassMainWorldCSP && !csp->allowManifestFromSource(url, cspR eporting)) | |
| 563 return false; | |
| 564 } | |
| 565 | |
| 560 // Measure the number of legacy URL schemes ('ftp://') and the number of emb edded-credential | 566 // Measure the number of legacy URL schemes ('ftp://') and the number of emb edded-credential |
| 561 // ('http://user:password@...') resources embedded as subresources. in the h opes that we can | 567 // ('http://user:password@...') resources embedded as subresources. in the h opes that we can |
| 562 // block them at some point in the future. | 568 // block them at some point in the future. |
| 563 if (resourceRequest.frameType() != WebURLRequest::FrameTypeTopLevel) { | 569 if (resourceRequest.frameType() != WebURLRequest::FrameTypeTopLevel) { |
| 564 if (SchemeRegistry::shouldTreatURLSchemeAsLegacy(url.protocol()) && !Sch emeRegistry::shouldTreatURLSchemeAsLegacy(frame()->document()->securityOrigin()- >protocol())) | 570 if (SchemeRegistry::shouldTreatURLSchemeAsLegacy(url.protocol()) && !Sch emeRegistry::shouldTreatURLSchemeAsLegacy(frame()->document()->securityOrigin()- >protocol())) |
| 565 UseCounter::count(frame()->document(), UseCounter::LegacyProtocolEmb eddedAsSubresource); | 571 UseCounter::count(frame()->document(), UseCounter::LegacyProtocolEmb eddedAsSubresource); |
| 566 if (!url.user().isEmpty() || !url.pass().isEmpty()) | 572 if (!url.user().isEmpty() || !url.pass().isEmpty()) |
| 567 UseCounter::count(frame()->document(), UseCounter::RequestedSubresou rceWithEmbeddedCredentials); | 573 UseCounter::count(frame()->document(), UseCounter::RequestedSubresou rceWithEmbeddedCredentials); |
| 568 } | 574 } |
| 569 | 575 |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1509 | 1515 |
| 1510 void ResourceFetcher::trace(Visitor* visitor) | 1516 void ResourceFetcher::trace(Visitor* visitor) |
| 1511 { | 1517 { |
| 1512 visitor->trace(m_document); | 1518 visitor->trace(m_document); |
| 1513 visitor->trace(m_loaders); | 1519 visitor->trace(m_loaders); |
| 1514 visitor->trace(m_multipartLoaders); | 1520 visitor->trace(m_multipartLoaders); |
| 1515 ResourceLoaderHost::trace(visitor); | 1521 ResourceLoaderHost::trace(visitor); |
| 1516 } | 1522 } |
| 1517 | 1523 |
| 1518 } | 1524 } |
| OLD | NEW |