| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 enum UpdateReason { | 69 enum UpdateReason { |
| 70 UpdateForAccess, | 70 UpdateForAccess, |
| 71 UpdateForPropertyChange | 71 UpdateForPropertyChange |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 // MemoryCacheEntry class is used only in MemoryCache class, but we don't make | 74 // MemoryCacheEntry class is used only in MemoryCache class, but we don't make |
| 75 // MemoryCacheEntry class an inner class of MemoryCache because of dependency | 75 // MemoryCacheEntry class an inner class of MemoryCache because of dependency |
| 76 // from MemoryCacheLRUList. | 76 // from MemoryCacheLRUList. |
| 77 class MemoryCacheEntry final : public DummyBase<MemoryCacheEntry> { | 77 class MemoryCacheEntry final { |
| 78 public: | 78 public: |
| 79 static PassOwnPtr<MemoryCacheEntry> create(Resource* resource) { return adop
tPtr(new MemoryCacheEntry(resource)); } | 79 static PassOwnPtr<MemoryCacheEntry> create(Resource* resource) { return adop
tPtr(new MemoryCacheEntry(resource)); } |
| 80 void trace(Visitor*); | 80 void trace(Visitor*); |
| 81 | 81 |
| 82 ResourcePtr<Resource> m_resource; | 82 ResourcePtr<Resource> m_resource; |
| 83 bool m_inLiveDecodedResourcesList; | 83 bool m_inLiveDecodedResourcesList; |
| 84 unsigned m_accessCount; | 84 unsigned m_accessCount; |
| 85 MemoryCacheLiveResourcePriority m_liveResourcePriority; | 85 MemoryCacheLiveResourcePriority m_liveResourcePriority; |
| 86 double m_lastDecodedAccessTime; // Used as a thrash guard | 86 double m_lastDecodedAccessTime; // Used as a thrash guard |
| 87 | 87 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 117 MemoryCacheLRUList() : m_head(nullptr), m_tail(nullptr) { } | 117 MemoryCacheLRUList() : m_head(nullptr), m_tail(nullptr) { } |
| 118 void trace(Visitor*); | 118 void trace(Visitor*); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } | 121 } |
| 122 | 122 |
| 123 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::MemoryCacheLRUList); | 123 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::MemoryCacheLRUList); |
| 124 | 124 |
| 125 namespace blink { | 125 namespace blink { |
| 126 | 126 |
| 127 class MemoryCache final : public DummyBase<MemoryCache> { | 127 class MemoryCache final { |
| 128 WTF_MAKE_NONCOPYABLE(MemoryCache); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 128 WTF_MAKE_NONCOPYABLE(MemoryCache); WTF_MAKE_FAST_ALLOCATED; |
| 129 public: | 129 public: |
| 130 static PassOwnPtr<MemoryCache> create(); | 130 static PassOwnPtr<MemoryCache> create(); |
| 131 ~MemoryCache(); | 131 ~MemoryCache(); |
| 132 void trace(Visitor*); | 132 void trace(Visitor*); |
| 133 | 133 |
| 134 struct TypeStatistic { | 134 struct TypeStatistic { |
| 135 int count; | 135 int count; |
| 136 int size; | 136 int size; |
| 137 int liveSize; | 137 int liveSize; |
| 138 int decodedSize; | 138 int decodedSize; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Returns the global cache. | 286 // Returns the global cache. |
| 287 MemoryCache* memoryCache(); | 287 MemoryCache* memoryCache(); |
| 288 | 288 |
| 289 // Sets the global cache, used to swap in a test instance. Returns the old | 289 // Sets the global cache, used to swap in a test instance. Returns the old |
| 290 // MemoryCache object. | 290 // MemoryCache object. |
| 291 PassOwnPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtr<MemoryCache>); | 291 PassOwnPtr<MemoryCache> replaceMemoryCacheForTesting(PassOwnPtr<MemoryCache>); |
| 292 | 292 |
| 293 } | 293 } |
| 294 | 294 |
| 295 #endif | 295 #endif |
| OLD | NEW |