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

Side by Side Diff: Source/core/fetch/MemoryCache.h

Issue 649213002: Oilpan: eager resource disposal on MemoryCache eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | Source/core/fetch/MemoryCache.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) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 4 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 enum UpdateReason { 67 enum UpdateReason {
68 UpdateForAccess, 68 UpdateForAccess,
69 UpdateForPropertyChange 69 UpdateForPropertyChange
70 }; 70 };
71 71
72 // MemoryCacheEntry class is used only in MemoryCache class, but we don't make 72 // MemoryCacheEntry class is used only in MemoryCache class, but we don't make
73 // MemoryCacheEntry class an inner class of MemoryCache because of dependency 73 // MemoryCacheEntry class an inner class of MemoryCache because of dependency
74 // from MemoryCacheLRUList. 74 // from MemoryCacheLRUList.
75 class MemoryCacheEntry final : public NoBaseWillBeGarbageCollectedFinalized<Memo ryCacheEntry> { 75 class MemoryCacheEntry final : public NoBaseWillBeGarbageCollectedFinalized<Memo ryCacheEntry> {
76 public: 76 public:
77 static PassOwnPtrWillBeRawPtr<MemoryCacheEntry> create(Resource* resource) { return adoptPtrWillBeNoop(new MemoryCacheEntry(resource)); } 77 static PassOwnPtrWillBeRawPtr<MemoryCacheEntry> create(Resource* resource)
78 {
79 return adoptPtrWillBeNoop(new MemoryCacheEntry(resource));
80 }
78 void trace(Visitor*); 81 void trace(Visitor*);
82 #if ENABLE(OILPAN)
83 void dispose();
84 #endif
79 85
80 ResourcePtr<Resource> m_resource; 86 ResourcePtr<Resource> m_resource;
81 bool m_inLiveDecodedResourcesList; 87 bool m_inLiveDecodedResourcesList;
82 unsigned m_accessCount; 88 unsigned m_accessCount;
83 MemoryCacheLiveResourcePriority m_liveResourcePriority; 89 MemoryCacheLiveResourcePriority m_liveResourcePriority;
84 double m_lastDecodedAccessTime; // Used as a thrash guard 90 double m_lastDecodedAccessTime; // Used as a thrash guard
85 91
86 RawPtrWillBeMember<MemoryCacheEntry> m_previousInLiveResourcesList; 92 RawPtrWillBeMember<MemoryCacheEntry> m_previousInLiveResourcesList;
87 RawPtrWillBeMember<MemoryCacheEntry> m_nextInLiveResourcesList; 93 RawPtrWillBeMember<MemoryCacheEntry> m_nextInLiveResourcesList;
88 RawPtrWillBeMember<MemoryCacheEntry> m_previousInAllResourcesList; 94 RawPtrWillBeMember<MemoryCacheEntry> m_previousInAllResourcesList;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // Returns the global cache. 299 // Returns the global cache.
294 MemoryCache* memoryCache(); 300 MemoryCache* memoryCache();
295 301
296 // Sets the global cache, used to swap in a test instance. Returns the old 302 // Sets the global cache, used to swap in a test instance. Returns the old
297 // MemoryCache object. 303 // MemoryCache object.
298 PassOwnPtrWillBeRawPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtrWillB eRawPtr<MemoryCache>); 304 PassOwnPtrWillBeRawPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtrWillB eRawPtr<MemoryCache>);
299 305
300 } 306 }
301 307
302 #endif 308 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/fetch/MemoryCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698