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

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

Issue 2518273003: [Blink Heap] Move isLowEndDevice to Memory Coordinator, attempt #3 (Closed)
Patch Set: Created 4 years 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 : m_inPruneResources(false), 77 : m_inPruneResources(false),
78 m_prunePending(false), 78 m_prunePending(false),
79 m_maxPruneDeferralDelay(cMaxPruneDeferralDelay), 79 m_maxPruneDeferralDelay(cMaxPruneDeferralDelay),
80 m_pruneTimeStamp(0.0), 80 m_pruneTimeStamp(0.0),
81 m_pruneFrameTimeStamp(0.0), 81 m_pruneFrameTimeStamp(0.0),
82 m_lastFramePaintTimeStamp(0.0), 82 m_lastFramePaintTimeStamp(0.0),
83 m_capacity(cDefaultCacheCapacity), 83 m_capacity(cDefaultCacheCapacity),
84 m_delayBeforeLiveDecodedPrune(cMinDelayBeforeLiveDecodedPrune), 84 m_delayBeforeLiveDecodedPrune(cMinDelayBeforeLiveDecodedPrune),
85 m_size(0) { 85 m_size(0) {
86 MemoryCacheDumpProvider::instance()->setMemoryCache(this); 86 MemoryCacheDumpProvider::instance()->setMemoryCache(this);
87 if (ProcessHeap::isLowEndDevice()) 87 if (MemoryCoordinator::isLowEndDevice())
88 MemoryCoordinator::instance().registerClient(this); 88 MemoryCoordinator::instance().registerClient(this);
89 } 89 }
90 90
91 MemoryCache* MemoryCache::create() { 91 MemoryCache* MemoryCache::create() {
92 return new MemoryCache; 92 return new MemoryCache;
93 } 93 }
94 94
95 MemoryCache::~MemoryCache() { 95 MemoryCache::~MemoryCache() {
96 if (m_prunePending) 96 if (m_prunePending)
97 Platform::current()->currentThread()->removeTaskObserver(this); 97 Platform::current()->currentThread()->removeTaskObserver(this);
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 } 459 }
460 return true; 460 return true;
461 } 461 }
462 462
463 void MemoryCache::onMemoryPressure(WebMemoryPressureLevel level) { 463 void MemoryCache::onMemoryPressure(WebMemoryPressureLevel level) {
464 pruneAll(); 464 pruneAll();
465 } 465 }
466 466
467 } // namespace blink 467 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698