| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "core/fetch/ScriptResource.h" | 44 #include "core/fetch/ScriptResource.h" |
| 45 #include "core/fetch/XSLStyleSheetResource.h" | 45 #include "core/fetch/XSLStyleSheetResource.h" |
| 46 #include "core/html/HTMLElement.h" | 46 #include "core/html/HTMLElement.h" |
| 47 #include "core/html/HTMLFrameOwnerElement.h" | 47 #include "core/html/HTMLFrameOwnerElement.h" |
| 48 #include "core/html/imports/HTMLImportsController.h" | 48 #include "core/html/imports/HTMLImportsController.h" |
| 49 #include "core/inspector/ConsoleMessage.h" | 49 #include "core/inspector/ConsoleMessage.h" |
| 50 #include "core/inspector/InspectorInstrumentation.h" | 50 #include "core/inspector/InspectorInstrumentation.h" |
| 51 #include "core/loader/DocumentLoader.h" | 51 #include "core/loader/DocumentLoader.h" |
| 52 #include "core/loader/FrameLoader.h" | 52 #include "core/loader/FrameLoader.h" |
| 53 #include "core/loader/FrameLoaderClient.h" | 53 #include "core/loader/FrameLoaderClient.h" |
| 54 #include "core/loader/MixedContentChecker.h" |
| 54 #include "core/loader/PingLoader.h" | 55 #include "core/loader/PingLoader.h" |
| 55 #include "core/loader/SubstituteData.h" | 56 #include "core/loader/SubstituteData.h" |
| 56 #include "core/loader/UniqueIdentifier.h" | 57 #include "core/loader/UniqueIdentifier.h" |
| 57 #include "core/loader/appcache/ApplicationCacheHost.h" | 58 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 58 #include "core/frame/LocalDOMWindow.h" | 59 #include "core/frame/LocalDOMWindow.h" |
| 59 #include "core/frame/LocalFrame.h" | 60 #include "core/frame/LocalFrame.h" |
| 60 #include "core/frame/csp/ContentSecurityPolicy.h" | 61 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 61 #include "core/timing/Performance.h" | 62 #include "core/timing/Performance.h" |
| 62 #include "core/timing/ResourceTimingInfo.h" | 63 #include "core/timing/ResourceTimingInfo.h" |
| 63 #include "core/frame/Settings.h" | 64 #include "core/frame/Settings.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 // If we're loading the main resource of a subframe, ensure that we treat th
e resource as active | 558 // If we're loading the main resource of a subframe, ensure that we treat th
e resource as active |
| 558 // content for the purposes of mixed content checks, and that we check again
st the parent of the | 559 // content for the purposes of mixed content checks, and that we check again
st the parent of the |
| 559 // active frame, rather than the frame itself. | 560 // active frame, rather than the frame itself. |
| 560 LocalFrame* effectiveFrame = frame(); | 561 LocalFrame* effectiveFrame = frame(); |
| 561 if (resourceRequest.frameType() == WebURLRequest::FrameTypeNested) { | 562 if (resourceRequest.frameType() == WebURLRequest::FrameTypeNested) { |
| 562 // FIXME: Deal with RemoteFrames. | 563 // FIXME: Deal with RemoteFrames. |
| 563 if (frame()->tree().parent()->isLocalFrame()) | 564 if (frame()->tree().parent()->isLocalFrame()) |
| 564 effectiveFrame = toLocalFrame(frame()->tree().parent()); | 565 effectiveFrame = toLocalFrame(frame()->tree().parent()); |
| 565 } | 566 } |
| 566 | 567 |
| 567 return !MixedContentChecker::shouldBlockFetch(effectiveFrame, resourceReques
t, url); | 568 return !MixedContentChecker::shouldBlockFetch(effectiveFrame, resourceReques
t.requestContext(), resourceRequest.frameType(), url); |
| 568 } | 569 } |
| 569 | 570 |
| 570 bool ResourceFetcher::canAccessResource(Resource* resource, SecurityOrigin* sour
ceOrigin, const KURL& url) const | 571 bool ResourceFetcher::canAccessResource(Resource* resource, SecurityOrigin* sour
ceOrigin, const KURL& url) const |
| 571 { | 572 { |
| 572 // Redirects can change the response URL different from one of request. | 573 // Redirects can change the response URL different from one of request. |
| 573 if (!canRequest(resource->type(), resource->resourceRequest(), url, resource
->options(), resource->isUnusedPreload(), FetchRequest::UseDefaultOriginRestrict
ionForType)) | 574 if (!canRequest(resource->type(), resource->resourceRequest(), url, resource
->options(), resource->isUnusedPreload(), FetchRequest::UseDefaultOriginRestrict
ionForType)) |
| 574 return false; | 575 return false; |
| 575 | 576 |
| 576 if (!sourceOrigin && document()) | 577 if (!sourceOrigin && document()) |
| 577 sourceOrigin = document()->securityOrigin(); | 578 sourceOrigin = document()->securityOrigin(); |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 | 1491 |
| 1491 void ResourceFetcher::trace(Visitor* visitor) | 1492 void ResourceFetcher::trace(Visitor* visitor) |
| 1492 { | 1493 { |
| 1493 visitor->trace(m_document); | 1494 visitor->trace(m_document); |
| 1494 visitor->trace(m_loaders); | 1495 visitor->trace(m_loaders); |
| 1495 visitor->trace(m_multipartLoaders); | 1496 visitor->trace(m_multipartLoaders); |
| 1496 ResourceLoaderHost::trace(visitor); | 1497 ResourceLoaderHost::trace(visitor); |
| 1497 } | 1498 } |
| 1498 | 1499 |
| 1499 } | 1500 } |
| OLD | NEW |