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

Side by Side Diff: Source/core/loader/cache/ResourceFetcher.cpp

Issue 19597008: If a resource load is started as the CachedResourceLoader is going away, make sure we remove the Ca… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: + test Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/loader/cache/ResourceFetcherTest.cpp » ('j') | 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/loader/cache/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698