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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 bool ResourceFetcher::defersLoading() const | 932 bool ResourceFetcher::defersLoading() const |
933 { | 933 { |
934 return context().defersLoading(); | 934 return context().defersLoading(); |
935 } | 935 } |
936 | 936 |
937 bool ResourceFetcher::isLoadedBy(ResourceFetcher* possibleOwner) const | 937 bool ResourceFetcher::isLoadedBy(ResourceFetcher* possibleOwner) const |
938 { | 938 { |
939 return this == possibleOwner; | 939 return this == possibleOwner; |
940 } | 940 } |
941 | 941 |
942 bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& req
uest, const ResourceResponse& redirectResponse, ResourceLoaderOptions& options) | 942 bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& new
Request, const ResourceResponse& redirectResponse, ResourceLoaderOptions& option
s) |
943 { | 943 { |
944 if (!context().canRequest(resource->type(), request, request.url(), options,
resource->isUnusedPreload(), FetchRequest::UseDefaultOriginRestrictionForType)) | 944 if (!context().canRequest(resource->type(), newRequest, newRequest.url(), op
tions, resource->isUnusedPreload(), FetchRequest::UseDefaultOriginRestrictionFor
Type)) |
945 return false; | 945 return false; |
946 if (options.corsEnabled == IsCORSEnabled) { | 946 if (options.corsEnabled == IsCORSEnabled) { |
947 SecurityOrigin* sourceOrigin = options.securityOrigin.get(); | 947 SecurityOrigin* sourceOrigin = options.securityOrigin.get(); |
948 if (!sourceOrigin) | 948 if (!sourceOrigin) |
949 sourceOrigin = context().securityOrigin(); | 949 sourceOrigin = context().securityOrigin(); |
950 | 950 |
951 String errorMessage; | 951 String errorMessage; |
952 StoredCredentials withCredentials = resource->lastResourceRequest().allo
wStoredCredentials() ? AllowStoredCredentials : DoNotAllowStoredCredentials; | 952 StoredCredentials withCredentials = resource->lastResourceRequest().allo
wStoredCredentials() ? AllowStoredCredentials : DoNotAllowStoredCredentials; |
953 if (!CrossOriginAccessControl::handleRedirect(sourceOrigin, request, red
irectResponse, withCredentials, options, errorMessage)) { | 953 if (!CrossOriginAccessControl::handleRedirect(sourceOrigin, newRequest,
redirectResponse, withCredentials, options, errorMessage)) { |
954 resource->setCORSFailed(); | 954 resource->setCORSFailed(); |
955 context().addConsoleMessage(errorMessage); | 955 context().addConsoleMessage(errorMessage); |
956 return false; | 956 return false; |
957 } | 957 } |
958 } | 958 } |
959 if (resource->type() == Resource::Image && shouldDeferImageLoad(request.url(
))) | 959 if (resource->type() == Resource::Image && shouldDeferImageLoad(newRequest.u
rl())) |
960 return false; | 960 return false; |
961 return true; | 961 return true; |
962 } | 962 } |
963 | 963 |
964 #if PRELOAD_DEBUG | 964 #if PRELOAD_DEBUG |
965 void ResourceFetcher::printPreloadStats() | 965 void ResourceFetcher::printPreloadStats() |
966 { | 966 { |
967 if (!m_preloads) | 967 if (!m_preloads) |
968 return; | 968 return; |
969 | 969 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 | 1059 |
1060 DEFINE_TRACE(ResourceFetcher) | 1060 DEFINE_TRACE(ResourceFetcher) |
1061 { | 1061 { |
1062 visitor->trace(m_context); | 1062 visitor->trace(m_context); |
1063 visitor->trace(m_archiveResourceCollection); | 1063 visitor->trace(m_archiveResourceCollection); |
1064 visitor->trace(m_loaders); | 1064 visitor->trace(m_loaders); |
1065 visitor->trace(m_nonBlockingLoaders); | 1065 visitor->trace(m_nonBlockingLoaders); |
1066 } | 1066 } |
1067 | 1067 |
1068 } | 1068 } |
OLD | NEW |