| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad())
; | 343 resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad())
; |
| 344 resource->setOptions(request.options()); | 344 resource->setOptions(request.options()); |
| 345 // FIXME: We should provide a body stream here. | 345 // FIXME: We should provide a body stream here. |
| 346 resource->responseReceived(response, nullptr); | 346 resource->responseReceived(response, nullptr); |
| 347 resource->setDataBufferingPolicy(BufferData); | 347 resource->setDataBufferingPolicy(BufferData); |
| 348 if (data->size()) | 348 if (data->size()) |
| 349 resource->setResourceBuffer(data); | 349 resource->setResourceBuffer(data); |
| 350 resource->setIdentifier(createUniqueIdentifier()); | 350 resource->setIdentifier(createUniqueIdentifier()); |
| 351 resource->setCacheIdentifier(cacheIdentifier); | 351 resource->setCacheIdentifier(cacheIdentifier); |
| 352 resource->finish(); | 352 resource->finish(); |
| 353 memoryCache()->add(resource.get()); | 353 |
| 354 if (!substituteData.isValid()) |
| 355 memoryCache()->add(resource.get()); |
| 356 |
| 354 return resource.release(); | 357 return resource.release(); |
| 355 } | 358 } |
| 356 | 359 |
| 357 void ResourceFetcher::moveCachedNonBlockingResourceToBlocking(Resource* resource
, const FetchRequest& request) | 360 void ResourceFetcher::moveCachedNonBlockingResourceToBlocking(Resource* resource
, const FetchRequest& request) |
| 358 { | 361 { |
| 359 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue
to not-block even after being preloaded and discovered. | 362 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue
to not-block even after being preloaded and discovered. |
| 360 if (resource && resource->loader() && resource->isLoadEventBlockingResourceT
ype() && resource->isLinkPreload() && !request.forPreload()) { | 363 if (resource && resource->loader() && resource->isLoadEventBlockingResourceT
ype() && resource->isLinkPreload() && !request.forPreload()) { |
| 361 if (m_nonBlockingLoaders) | 364 if (m_nonBlockingLoaders) |
| 362 m_nonBlockingLoaders->remove(resource->loader()); | 365 m_nonBlockingLoaders->remove(resource->loader()); |
| 363 if (!m_loaders) | 366 if (!m_loaders) |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 visitor->trace(m_loaders); | 1216 visitor->trace(m_loaders); |
| 1214 visitor->trace(m_nonBlockingLoaders); | 1217 visitor->trace(m_nonBlockingLoaders); |
| 1215 #if ENABLE(OILPAN) | 1218 #if ENABLE(OILPAN) |
| 1216 visitor->trace(m_documentResources); | 1219 visitor->trace(m_documentResources); |
| 1217 visitor->trace(m_preloads); | 1220 visitor->trace(m_preloads); |
| 1218 visitor->trace(m_resourceTimingInfoMap); | 1221 visitor->trace(m_resourceTimingInfoMap); |
| 1219 #endif | 1222 #endif |
| 1220 } | 1223 } |
| 1221 | 1224 |
| 1222 } // namespace blink | 1225 } // namespace blink |
| OLD | NEW |