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

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

Issue 2326743003: Do not call MemoryCache::prune() when a client/observer is removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tet fix Created 4 years, 3 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 | « third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp ('k') | 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 { 722 {
723 if (!hasClientsOrObservers() && m_isAlive) { 723 if (!hasClientsOrObservers() && m_isAlive) {
724 m_isAlive = false; 724 m_isAlive = false;
725 memoryCache()->makeDead(this); 725 memoryCache()->makeDead(this);
726 allClientsAndObserversRemoved(); 726 allClientsAndObserversRemoved();
727 727
728 // RFC2616 14.9.2: 728 // RFC2616 14.9.2:
729 // "no-store: ... MUST make a best-effort attempt to remove the informat ion from volatile storage as promptly as possible" 729 // "no-store: ... MUST make a best-effort attempt to remove the informat ion from volatile storage as promptly as possible"
730 // "... History buffers MAY store such responses as part of their normal operation." 730 // "... History buffers MAY store such responses as part of their normal operation."
731 // We allow non-secure content to be reused in history, but we do not al low secure content to be reused. 731 // We allow non-secure content to be reused in history, but we do not al low secure content to be reused.
732 if (hasCacheControlNoStoreHeader() && url().protocolIs("https")) { 732 if (hasCacheControlNoStoreHeader() && url().protocolIs("https"))
733 memoryCache()->remove(this); 733 memoryCache()->remove(this);
yhirano 2016/09/15 08:30:43 Hm, is this statement still needed?
hiroshige 2016/09/15 08:45:33 I'm not sure. I created a CL https://codereview.ch
734 memoryCache()->prune();
735 } else {
736 memoryCache()->prune(this);
Nate Chapin 2016/09/16 21:28:47 I think this is the only callsite that passes a no
hiroshige 2016/09/29 06:27:17 Done.
737 }
738 } 734 }
739 // This object may be dead here.
740 } 735 }
741 736
742 void Resource::allClientsAndObserversRemoved() 737 void Resource::allClientsAndObserversRemoved()
743 { 738 {
744 if (!m_loader) 739 if (!m_loader)
745 return; 740 return;
746 if (m_type == Raw) 741 if (m_type == Raw)
747 cancelTimerFired(&m_cancelTimer); 742 cancelTimerFired(&m_cancelTimer);
748 else if (!m_cancelTimer.isActive()) 743 else if (!m_cancelTimer.isActive())
749 m_cancelTimer.startOneShot(0, BLINK_FROM_HERE); 744 m_cancelTimer.startOneShot(0, BLINK_FROM_HERE);
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 case Resource::TextTrack: 1060 case Resource::TextTrack:
1066 case Resource::Media: 1061 case Resource::Media:
1067 case Resource::Manifest: 1062 case Resource::Manifest:
1068 return false; 1063 return false;
1069 } 1064 }
1070 NOTREACHED(); 1065 NOTREACHED();
1071 return false; 1066 return false;
1072 } 1067 }
1073 1068
1074 } // namespace blink 1069 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698