| 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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 rights reserved. | 6 rights reserved. |
| 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 DCHECK(resource->stillNeedsLoad()); | 1277 DCHECK(resource->stillNeedsLoad()); |
| 1278 if (!context().shouldLoadNewResource(resource->getType())) { | 1278 if (!context().shouldLoadNewResource(resource->getType())) { |
| 1279 memoryCache()->remove(resource); | 1279 memoryCache()->remove(resource); |
| 1280 return false; | 1280 return false; |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 ResourceRequest request(resource->resourceRequest()); | 1283 ResourceRequest request(resource->resourceRequest()); |
| 1284 willSendRequest(resource->identifier(), request, ResourceResponse(), | 1284 willSendRequest(resource->identifier(), request, ResourceResponse(), |
| 1285 resource->options()); | 1285 resource->options()); |
| 1286 | 1286 |
| 1287 // TODO(shaochuan): Saving modified ResourceRequest back to |resource|, remove |
| 1288 // once willSendRequest() takes const ResourceRequest. crbug.com/632580 |
| 1289 resource->setResourceRequest(request); |
| 1290 |
| 1287 // Resource requests from suborigins should not be intercepted by the service | 1291 // Resource requests from suborigins should not be intercepted by the service |
| 1288 // worker of the physical origin. This has the effect that, for now, | 1292 // worker of the physical origin. This has the effect that, for now, |
| 1289 // suborigins do not work with service workers. See | 1293 // suborigins do not work with service workers. See |
| 1290 // https://w3c.github.io/webappsec-suborigins/. | 1294 // https://w3c.github.io/webappsec-suborigins/. |
| 1291 SecurityOrigin* sourceOrigin = context().getSecurityOrigin(); | 1295 SecurityOrigin* sourceOrigin = context().getSecurityOrigin(); |
| 1292 if (sourceOrigin && sourceOrigin->hasSuborigin()) | 1296 if (sourceOrigin && sourceOrigin->hasSuborigin()) |
| 1293 request.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::All); | 1297 request.setSkipServiceWorker(WebURLRequest::SkipServiceWorker::All); |
| 1294 | 1298 |
| 1295 ResourceLoader* loader = ResourceLoader::create(this, resource); | 1299 ResourceLoader* loader = ResourceLoader::create(this, resource); |
| 1296 if (resource->shouldBlockLoadEvent()) | 1300 if (resource->shouldBlockLoadEvent()) |
| 1297 m_loaders.add(loader); | 1301 m_loaders.add(loader); |
| 1298 else | 1302 else |
| 1299 m_nonBlockingLoaders.add(loader); | 1303 m_nonBlockingLoaders.add(loader); |
| 1300 | 1304 |
| 1301 storeResourceTimingInitiatorInformation(resource); | 1305 storeResourceTimingInitiatorInformation(resource); |
| 1302 resource->setFetcherSecurityOrigin(sourceOrigin); | 1306 resource->setFetcherSecurityOrigin(sourceOrigin); |
| 1307 |
| 1308 loader->activateCacheAwareLoadingIfNeeded(request); |
| 1303 loader->start(request, context().loadingTaskRunner(), | 1309 loader->start(request, context().loadingTaskRunner(), |
| 1304 context().defersLoading()); | 1310 context().defersLoading()); |
| 1305 return true; | 1311 return true; |
| 1306 } | 1312 } |
| 1307 | 1313 |
| 1308 void ResourceFetcher::removeResourceLoader(ResourceLoader* loader) { | 1314 void ResourceFetcher::removeResourceLoader(ResourceLoader* loader) { |
| 1309 if (m_loaders.contains(loader)) | 1315 if (m_loaders.contains(loader)) |
| 1310 m_loaders.remove(loader); | 1316 m_loaders.remove(loader); |
| 1311 else if (m_nonBlockingLoaders.contains(loader)) | 1317 else if (m_nonBlockingLoaders.contains(loader)) |
| 1312 m_nonBlockingLoaders.remove(loader); | 1318 m_nonBlockingLoaders.remove(loader); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 visitor->trace(m_context); | 1628 visitor->trace(m_context); |
| 1623 visitor->trace(m_archive); | 1629 visitor->trace(m_archive); |
| 1624 visitor->trace(m_loaders); | 1630 visitor->trace(m_loaders); |
| 1625 visitor->trace(m_nonBlockingLoaders); | 1631 visitor->trace(m_nonBlockingLoaders); |
| 1626 visitor->trace(m_documentResources); | 1632 visitor->trace(m_documentResources); |
| 1627 visitor->trace(m_preloads); | 1633 visitor->trace(m_preloads); |
| 1628 visitor->trace(m_resourceTimingInfoMap); | 1634 visitor->trace(m_resourceTimingInfoMap); |
| 1629 } | 1635 } |
| 1630 | 1636 |
| 1631 } // namespace blink | 1637 } // namespace blink |
| OLD | NEW |