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

Side by Side Diff: sky/engine/core/fetch/MemoryCache.cpp

Issue 683703003: Remove various Heap* types. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/fetch/MemoryCache.h ('k') | sky/engine/core/frame/LocalDOMWindow.h » ('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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 MemoryCache* memoryCache() 49 MemoryCache* memoryCache()
50 { 50 {
51 ASSERT(WTF::isMainThread()); 51 ASSERT(WTF::isMainThread());
52 if (!gMemoryCache) 52 if (!gMemoryCache)
53 gMemoryCache = new OwnPtr<MemoryCache>(MemoryCache::create()); 53 gMemoryCache = new OwnPtr<MemoryCache>(MemoryCache::create());
54 return gMemoryCache->get(); 54 return gMemoryCache->get();
55 } 55 }
56 56
57 PassOwnPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtr<MemoryCache> cac he) 57 PassOwnPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtr<MemoryCache> cac he)
58 { 58 {
59 #if ENABLE(OILPAN)
60 // Move m_liveResources content to keep Resource objects alive.
61 for (HeapHashSet<Member<Resource> >::iterator i = memoryCache()->m_liveResou rces.begin();
62 i != memoryCache()->m_liveResources.end();
63 ++i) {
64 cache->m_liveResources.add(*i);
65 }
66 memoryCache()->m_liveResources.clear();
67 #else
68 // Make sure we have non-empty gMemoryCache. 59 // Make sure we have non-empty gMemoryCache.
69 memoryCache(); 60 memoryCache();
70 #endif
71 OwnPtr<MemoryCache> oldCache = gMemoryCache->release(); 61 OwnPtr<MemoryCache> oldCache = gMemoryCache->release();
72 *gMemoryCache = cache; 62 *gMemoryCache = cache;
73 return oldCache.release(); 63 return oldCache.release();
74 } 64 }
75 65
76 void MemoryCacheEntry::trace(Visitor* visitor) 66 void MemoryCacheEntry::trace(Visitor* visitor)
77 { 67 {
78 visitor->trace(m_previousInLiveResourcesList); 68 visitor->trace(m_previousInLiveResourcesList);
79 visitor->trace(m_nextInLiveResourcesList); 69 visitor->trace(m_nextInLiveResourcesList);
80 visitor->trace(m_previousInAllResourcesList); 70 visitor->trace(m_previousInAllResourcesList);
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was Purged()); 746 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was Purged());
757 747
758 current = prev; 748 current = prev;
759 } 749 }
760 } 750 }
761 } 751 }
762 752
763 #endif // MEMORY_CACHE_STATS 753 #endif // MEMORY_CACHE_STATS
764 754
765 } // namespace blink 755 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/fetch/MemoryCache.h ('k') | sky/engine/core/frame/LocalDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698