OLD | NEW |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool m_inLiveDecodedResourcesList; | 79 bool m_inLiveDecodedResourcesList; |
80 unsigned m_accessCount; | 80 unsigned m_accessCount; |
81 double m_lastDecodedAccessTime; // Used as a thrash guard | 81 double m_lastDecodedAccessTime; // Used as a thrash guard |
82 | 82 |
83 Member<MemoryCacheEntry> m_previousInLiveResourcesList; | 83 Member<MemoryCacheEntry> m_previousInLiveResourcesList; |
84 Member<MemoryCacheEntry> m_nextInLiveResourcesList; | 84 Member<MemoryCacheEntry> m_nextInLiveResourcesList; |
85 Member<MemoryCacheEntry> m_previousInAllResourcesList; | 85 Member<MemoryCacheEntry> m_previousInAllResourcesList; |
86 Member<MemoryCacheEntry> m_nextInAllResourcesList; | 86 Member<MemoryCacheEntry> m_nextInAllResourcesList; |
87 | 87 |
88 private: | 88 private: |
89 explicit MemoryCacheEntry(Resource*); | 89 explicit MemoryCacheEntry(Resource* resource) |
| 90 : m_inLiveDecodedResourcesList(false) |
| 91 , m_accessCount(0) |
| 92 , m_lastDecodedAccessTime(0.0) |
| 93 , m_previousInLiveResourcesList(nullptr) |
| 94 , m_nextInLiveResourcesList(nullptr) |
| 95 , m_previousInAllResourcesList(nullptr) |
| 96 , m_nextInAllResourcesList(nullptr) |
| 97 , m_resource(resource) |
| 98 { |
| 99 } |
90 | 100 |
91 // Only one of |m_resource| or |m_resourceWeak| is used, based on | |
92 // RuntimeEnabledFeatures::weakMemoryCacheEnabled(). | |
93 // TODO(hiroshige): this switching mechanism is added for a field trial | |
94 // for Weak MemoryCache (https://crbug.com/603462) and should be reverted | |
95 // at least before going stable. | |
96 Member<Resource> m_resource; | 101 Member<Resource> m_resource; |
97 WeakMember<Resource> m_resourceWeak; | |
98 }; | 102 }; |
99 | 103 |
100 WILL_NOT_BE_EAGERLY_TRACED_CLASS(MemoryCacheEntry); | 104 WILL_NOT_BE_EAGERLY_TRACED_CLASS(MemoryCacheEntry); |
101 | 105 |
102 // MemoryCacheLRUList is used only in MemoryCache class, but we don't make | 106 // MemoryCacheLRUList is used only in MemoryCache class, but we don't make |
103 // MemoryCacheLRUList an inner struct of MemoryCache because we can't define | 107 // MemoryCacheLRUList an inner struct of MemoryCache because we can't define |
104 // VectorTraits for inner structs. | 108 // VectorTraits for inner structs. |
105 struct MemoryCacheLRUList final { | 109 struct MemoryCacheLRUList final { |
106 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 110 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
107 public: | 111 public: |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // Returns the global cache. | 309 // Returns the global cache. |
306 CORE_EXPORT MemoryCache* memoryCache(); | 310 CORE_EXPORT MemoryCache* memoryCache(); |
307 | 311 |
308 // Sets the global cache, used to swap in a test instance. Returns the old | 312 // Sets the global cache, used to swap in a test instance. Returns the old |
309 // MemoryCache object. | 313 // MemoryCache object. |
310 CORE_EXPORT MemoryCache* replaceMemoryCacheForTesting(MemoryCache*); | 314 CORE_EXPORT MemoryCache* replaceMemoryCacheForTesting(MemoryCache*); |
311 | 315 |
312 } // namespace blink | 316 } // namespace blink |
313 | 317 |
314 #endif | 318 #endif |
OLD | NEW |