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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 DCHECK(resource); | 1050 DCHECK(resource); |
1051 DCHECK(resource->stillNeedsLoad()); | 1051 DCHECK(resource->stillNeedsLoad()); |
1052 if (!context().shouldLoadNewResource(resource->getType())) { | 1052 if (!context().shouldLoadNewResource(resource->getType())) { |
1053 memoryCache()->remove(resource); | 1053 memoryCache()->remove(resource); |
1054 return false; | 1054 return false; |
1055 } | 1055 } |
1056 | 1056 |
1057 ResourceRequest request(resource->resourceRequest()); | 1057 ResourceRequest request(resource->resourceRequest()); |
1058 willSendRequest(resource->identifier(), request, ResourceResponse(), resourc
e->options()); | 1058 willSendRequest(resource->identifier(), request, ResourceResponse(), resourc
e->options()); |
1059 | 1059 |
| 1060 // Resource requests from suborigins should not be intercepted by the |
| 1061 // service worker of the physical origin. This has the effect that, for |
| 1062 // now, suborigins do not work with service workers. See |
| 1063 // https://w3c.github.io/webappsec-suborigins/. |
| 1064 SecurityOrigin* sourceOrigin = context().getSecurityOrigin(); |
| 1065 if (sourceOrigin && sourceOrigin->hasSuborigin()) |
| 1066 request.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::All); |
| 1067 |
1060 ResourceLoader* loader = ResourceLoader::create(this, resource); | 1068 ResourceLoader* loader = ResourceLoader::create(this, resource); |
1061 if (resource->shouldBlockLoadEvent()) | 1069 if (resource->shouldBlockLoadEvent()) |
1062 m_loaders.add(loader); | 1070 m_loaders.add(loader); |
1063 else | 1071 else |
1064 m_nonBlockingLoaders.add(loader); | 1072 m_nonBlockingLoaders.add(loader); |
1065 | 1073 |
1066 storeResourceTimingInitiatorInformation(resource); | 1074 storeResourceTimingInitiatorInformation(resource); |
1067 resource->setFetcherSecurityOrigin(context().getSecurityOrigin()); | 1075 resource->setFetcherSecurityOrigin(sourceOrigin); |
1068 loader->start(request, context().loadingTaskRunner(), context().defersLoadin
g()); | 1076 loader->start(request, context().loadingTaskRunner(), context().defersLoadin
g()); |
1069 return true; | 1077 return true; |
1070 } | 1078 } |
1071 | 1079 |
1072 void ResourceFetcher::removeResourceLoader(ResourceLoader* loader) | 1080 void ResourceFetcher::removeResourceLoader(ResourceLoader* loader) |
1073 { | 1081 { |
1074 if (m_loaders.contains(loader)) | 1082 if (m_loaders.contains(loader)) |
1075 m_loaders.remove(loader); | 1083 m_loaders.remove(loader); |
1076 else if (m_nonBlockingLoaders.contains(loader)) | 1084 else if (m_nonBlockingLoaders.contains(loader)) |
1077 m_nonBlockingLoaders.remove(loader); | 1085 m_nonBlockingLoaders.remove(loader); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 visitor->trace(m_context); | 1356 visitor->trace(m_context); |
1349 visitor->trace(m_archive); | 1357 visitor->trace(m_archive); |
1350 visitor->trace(m_loaders); | 1358 visitor->trace(m_loaders); |
1351 visitor->trace(m_nonBlockingLoaders); | 1359 visitor->trace(m_nonBlockingLoaders); |
1352 visitor->trace(m_documentResources); | 1360 visitor->trace(m_documentResources); |
1353 visitor->trace(m_preloads); | 1361 visitor->trace(m_preloads); |
1354 visitor->trace(m_resourceTimingInfoMap); | 1362 visitor->trace(m_resourceTimingInfoMap); |
1355 } | 1363 } |
1356 | 1364 |
1357 } // namespace blink | 1365 } // namespace blink |
OLD | NEW |