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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // |m_preloads| only, because they are major sources of references. | 403 // |m_preloads| only, because they are major sources of references. |
404 if (resource && !resource->hasClientsOrObservers() && (!m_preloads || !m_pre
loads->contains(resource))) { | 404 if (resource && !resource->hasClientsOrObservers() && (!m_preloads || !m_pre
loads->contains(resource))) { |
405 DEFINE_RESOURCE_HISTOGRAM("Dead."); | 405 DEFINE_RESOURCE_HISTOGRAM("Dead."); |
406 } | 406 } |
407 } | 407 } |
408 | 408 |
409 Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource
Factory& factory, const SubstituteData& substituteData) | 409 Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource
Factory& factory, const SubstituteData& substituteData) |
410 { | 410 { |
411 ASSERT(request.options().synchronousPolicy == RequestAsynchronously || facto
ry.type() == Resource::Raw || factory.type() == Resource::XSLStyleSheet); | 411 ASSERT(request.options().synchronousPolicy == RequestAsynchronously || facto
ry.type() == Resource::Raw || factory.type() == Resource::XSLStyleSheet); |
412 | 412 |
413 context().upgradeInsecureRequest(request); | 413 if (request.resourceRequest().httpHeaderField("Upgrade-Insecure-Requests") !
= AtomicString("1")) |
| 414 context().upgradeInsecureRequest(request.mutableResourceRequest()); |
414 context().addClientHintsIfNecessary(request); | 415 context().addClientHintsIfNecessary(request); |
415 context().addCSPHeaderIfNecessary(factory.type(), request); | 416 context().addCSPHeaderIfNecessary(factory.type(), request); |
416 | 417 |
417 TRACE_EVENT1("blink", "ResourceFetcher::requestResource", "url", urlForTrace
Event(request.url())); | 418 TRACE_EVENT1("blink", "ResourceFetcher::requestResource", "url", urlForTrace
Event(request.url())); |
418 | 419 |
419 if (!request.url().isValid()) | 420 if (!request.url().isValid()) |
420 return nullptr; | 421 return nullptr; |
421 | 422 |
422 if (!context().canRequest(factory.type(), request.resourceRequest(), MemoryC
ache::removeFragmentIdentifierIfNeeded(request.url()), request.options(), reques
t.forPreload(), request.getOriginRestriction())) | 423 if (!context().canRequest(factory.type(), request.resourceRequest(), MemoryC
ache::removeFragmentIdentifierIfNeeded(request.url()), request.options(), reques
t.forPreload(), request.getOriginRestriction())) |
423 return nullptr; | 424 return nullptr; |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 visitor->trace(m_context); | 1262 visitor->trace(m_context); |
1262 visitor->trace(m_archive); | 1263 visitor->trace(m_archive); |
1263 visitor->trace(m_loaders); | 1264 visitor->trace(m_loaders); |
1264 visitor->trace(m_nonBlockingLoaders); | 1265 visitor->trace(m_nonBlockingLoaders); |
1265 visitor->trace(m_documentResources); | 1266 visitor->trace(m_documentResources); |
1266 visitor->trace(m_preloads); | 1267 visitor->trace(m_preloads); |
1267 visitor->trace(m_resourceTimingInfoMap); | 1268 visitor->trace(m_resourceTimingInfoMap); |
1268 } | 1269 } |
1269 | 1270 |
1270 } // namespace blink | 1271 } // namespace blink |
OLD | NEW |