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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
493 | 493 |
494 if (!request.forPreload() || policy != Use) { | 494 if (!request.forPreload() || policy != Use) { |
495 ResourceLoadPriority priority = loadPriority(type, request); | 495 ResourceLoadPriority priority = loadPriority(type, request); |
496 if (priority != resource->resourceRequest().priority()) { | 496 if (priority != resource->resourceRequest().priority()) { |
497 resource->resourceRequest().setPriority(priority); | 497 resource->resourceRequest().setPriority(priority); |
498 resource->didChangePriority(priority); | 498 resource->didChangePriority(priority); |
499 } | 499 } |
500 } | 500 } |
501 | 501 |
502 if ((policy != Use || resource->stillNeedsLoad()) && CachedResourceRequest:: NoDefer == request.defer()) { | 502 if ((policy != Use || resource->stillNeedsLoad()) && CachedResourceRequest:: NoDefer == request.defer()) { |
503 if (!frame()) | 503 if (!frame() || m_documentLoader != frame()->loader()->activeDocumentLoa der() || m_documentLoader->isStopping()) { |
Nate Chapin
2013/07/23 23:13:17
I believe the last 2 cases are a more succinct and
| |
504 if (resource->inCache()) | |
505 memoryCache()->remove(resource.get()); | |
504 return 0; | 506 return 0; |
505 | 507 } |
506 FrameLoader* frameLoader = this->frameLoader(); | |
507 if (request.options().securityCheck == DoSecurityCheck && (frameLoader-> state() == FrameStateProvisional || !frameLoader->activeDocumentLoader() || fram eLoader->activeDocumentLoader()->isStopping())) | |
508 return 0; | |
509 | 508 |
510 if (!m_documentLoader->scheduleArchiveLoad(resource.get(), request.resou rceRequest())) | 509 if (!m_documentLoader->scheduleArchiveLoad(resource.get(), request.resou rceRequest())) |
511 resource->load(this, request.options()); | 510 resource->load(this, request.options()); |
512 | 511 |
513 // We don't support immediate loads, but we do support immediate failure . | 512 // We don't support immediate loads, but we do support immediate failure . |
514 if (resource->errorOccurred()) { | 513 if (resource->errorOccurred()) { |
515 if (resource->inCache()) | 514 if (resource->inCache()) |
516 memoryCache()->remove(resource.get()); | 515 memoryCache()->remove(resource.get()); |
517 return 0; | 516 return 0; |
518 } | 517 } |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1252 } | 1251 } |
1253 #endif | 1252 #endif |
1254 | 1253 |
1255 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions( ) | 1254 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions( ) |
1256 { | 1255 { |
1257 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); | 1256 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); |
1258 return options; | 1257 return options; |
1259 } | 1258 } |
1260 | 1259 |
1261 } | 1260 } |
OLD | NEW |