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