Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 1748723002: Do not add Resource for SubstituteData to MemoryCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SVG_0_preCacheData
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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());
Nate Chapin 2016/03/01 17:51:42 There is a special case related to substitue data
hiroshige 2016/03/02 01:06:39 Done.
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698