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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 { | 1025 { |
1026 DCHECK(resource && resource->stillNeedsLoad()); | 1026 DCHECK(resource && resource->stillNeedsLoad()); |
1027 if (!context().shouldLoadNewResource(resource->getType())) { | 1027 if (!context().shouldLoadNewResource(resource->getType())) { |
1028 memoryCache()->remove(resource); | 1028 memoryCache()->remove(resource); |
1029 return false; | 1029 return false; |
1030 } | 1030 } |
1031 | 1031 |
1032 ResourceRequest request(resource->resourceRequest()); | 1032 ResourceRequest request(resource->resourceRequest()); |
1033 willSendRequest(resource->identifier(), request, ResourceResponse(), resourc
e->options()); | 1033 willSendRequest(resource->identifier(), request, ResourceResponse(), resourc
e->options()); |
1034 | 1034 |
| 1035 // Resource requests from suborigins should not be intercepted by the |
| 1036 // service worker of the physical origin. This has the effect that, for |
| 1037 // now, suborigins do not work with service workers. See |
| 1038 // https://w3c.github.io/webappsec-suborigins/. |
| 1039 SecurityOrigin* sourceOrigin = context().getSecurityOrigin(); |
| 1040 if (sourceOrigin && sourceOrigin->hasSuborigin()) |
| 1041 request.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::All); |
| 1042 |
1035 ResourceLoader* loader = ResourceLoader::create(this, resource); | 1043 ResourceLoader* loader = ResourceLoader::create(this, resource); |
1036 if (resource->shouldBlockLoadEvent()) | 1044 if (resource->shouldBlockLoadEvent()) |
1037 m_loaders.add(loader); | 1045 m_loaders.add(loader); |
1038 else | 1046 else |
1039 m_nonBlockingLoaders.add(loader); | 1047 m_nonBlockingLoaders.add(loader); |
1040 | 1048 |
1041 storeResourceTimingInitiatorInformation(resource); | 1049 storeResourceTimingInitiatorInformation(resource); |
1042 resource->setFetcherSecurityOrigin(context().getSecurityOrigin()); | 1050 resource->setFetcherSecurityOrigin(sourceOrigin); |
1043 loader->start(request, context().loadingTaskRunner(), context().defersLoadin
g()); | 1051 loader->start(request, context().loadingTaskRunner(), context().defersLoadin
g()); |
1044 return true; | 1052 return true; |
1045 } | 1053 } |
1046 | 1054 |
1047 void ResourceFetcher::removeResourceLoader(ResourceLoader* loader) | 1055 void ResourceFetcher::removeResourceLoader(ResourceLoader* loader) |
1048 { | 1056 { |
1049 if (m_loaders.contains(loader)) | 1057 if (m_loaders.contains(loader)) |
1050 m_loaders.remove(loader); | 1058 m_loaders.remove(loader); |
1051 else if (m_nonBlockingLoaders.contains(loader)) | 1059 else if (m_nonBlockingLoaders.contains(loader)) |
1052 m_nonBlockingLoaders.remove(loader); | 1060 m_nonBlockingLoaders.remove(loader); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 visitor->trace(m_context); | 1331 visitor->trace(m_context); |
1324 visitor->trace(m_archive); | 1332 visitor->trace(m_archive); |
1325 visitor->trace(m_loaders); | 1333 visitor->trace(m_loaders); |
1326 visitor->trace(m_nonBlockingLoaders); | 1334 visitor->trace(m_nonBlockingLoaders); |
1327 visitor->trace(m_documentResources); | 1335 visitor->trace(m_documentResources); |
1328 visitor->trace(m_preloads); | 1336 visitor->trace(m_preloads); |
1329 visitor->trace(m_resourceTimingInfoMap); | 1337 visitor->trace(m_resourceTimingInfoMap); |
1330 } | 1338 } |
1331 | 1339 |
1332 } // namespace blink | 1340 } // namespace blink |
OLD | NEW |