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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 pruneNow(currentTime, MaximalPrune); 704 pruneNow(currentTime, MaximalPrune);
705 } 705 }
706 706
707 void MemoryCache::pruneNow(double currentTime, PruneStrategy strategy) 707 void MemoryCache::pruneNow(double currentTime, PruneStrategy strategy)
708 { 708 {
709 if (m_prunePending) { 709 if (m_prunePending) {
710 m_prunePending = false; 710 m_prunePending = false;
711 Platform::current()->currentThread()->removeTaskObserver(this); 711 Platform::current()->currentThread()->removeTaskObserver(this);
712 } 712 }
713 713
714 TemporaryChange<bool> reentrancyProtector(m_inPruneResources, true); 714 TemporaryChange<bool> reentrancyProtector(&m_inPruneResources, true);
715 pruneDeadResources(strategy); // Prune dead first, in case it was "borrowing " capacity from live. 715 pruneDeadResources(strategy); // Prune dead first, in case it was "borrowing " capacity from live.
716 pruneLiveResources(strategy); 716 pruneLiveResources(strategy);
717 m_pruneFrameTimeStamp = m_lastFramePaintTimeStamp; 717 m_pruneFrameTimeStamp = m_lastFramePaintTimeStamp;
718 m_pruneTimeStamp = currentTime; 718 m_pruneTimeStamp = currentTime;
719 } 719 }
720 720
721 void MemoryCache::updateFramePaintTimestamp() 721 void MemoryCache::updateFramePaintTimestamp()
722 { 722 {
723 m_lastFramePaintTimeStamp = currentTime(); 723 m_lastFramePaintTimeStamp = currentTime();
724 } 724 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 printf("(%.1fK, %.1fK, %uA, %dR, %d); ", currentResource->decode dSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSi ze()) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers( ), currentResource->isPurgeable()); 781 printf("(%.1fK, %.1fK, %uA, %dR, %d); ", currentResource->decode dSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSi ze()) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers( ), currentResource->isPurgeable());
782 782
783 current = current->m_previousInAllResourcesList; 783 current = current->m_previousInAllResourcesList;
784 } 784 }
785 } 785 }
786 } 786 }
787 787
788 #endif // MEMORY_CACHE_STATS 788 #endif // MEMORY_CACHE_STATS
789 789
790 } // namespace blink 790 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698