OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 public: | 61 public: |
62 DEFINE_INLINE_TRACE() { visitor->trace(value); } | 62 DEFINE_INLINE_TRACE() { visitor->trace(value); } |
63 | 63 |
64 PresentationAttributeCacheKey key; | 64 PresentationAttributeCacheKey key; |
65 Member<StylePropertySet> value; | 65 Member<StylePropertySet> value; |
66 }; | 66 }; |
67 | 67 |
68 using PresentationAttributeCache = HeapHashMap<unsigned, Member<PresentationAttr
ibuteCacheEntry>, AlreadyHashed>; | 68 using PresentationAttributeCache = HeapHashMap<unsigned, Member<PresentationAttr
ibuteCacheEntry>, AlreadyHashed>; |
69 static PresentationAttributeCache& presentationAttributeCache() | 69 static PresentationAttributeCache& presentationAttributeCache() |
70 { | 70 { |
71 DEFINE_STATIC_LOCAL(Persistent<PresentationAttributeCache>, cache, (new Pres
entationAttributeCache())); | 71 DEFINE_STATIC_LOCAL(PresentationAttributeCache, cache, (new PresentationAttr
ibuteCache)); |
72 return *cache; | 72 return cache; |
73 } | 73 } |
74 | 74 |
75 class PresentationAttributeCacheCleaner { | 75 class PresentationAttributeCacheCleaner { |
76 WTF_MAKE_NONCOPYABLE(PresentationAttributeCacheCleaner); USING_FAST_MALLOC(P
resentationAttributeCacheCleaner); | 76 WTF_MAKE_NONCOPYABLE(PresentationAttributeCacheCleaner); USING_FAST_MALLOC(P
resentationAttributeCacheCleaner); |
77 public: | 77 public: |
78 PresentationAttributeCacheCleaner() | 78 PresentationAttributeCacheCleaner() |
79 : m_hitCount(0) | 79 : m_hitCount(0) |
80 , m_cleanTimer(this, &PresentationAttributeCacheCleaner::cleanCache) | 80 , m_cleanTimer(this, &PresentationAttributeCacheCleaner::cleanCache) |
81 { | 81 { |
82 } | 82 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 presentationAttributeCache().clear(); | 198 presentationAttributeCache().clear(); |
199 presentationAttributeCache().set(cacheHash, newEntry.release()); | 199 presentationAttributeCache().set(cacheHash, newEntry.release()); |
200 } else { | 200 } else { |
201 cacheValue->value = newEntry.release(); | 201 cacheValue->value = newEntry.release(); |
202 } | 202 } |
203 | 203 |
204 return style.release(); | 204 return style.release(); |
205 } | 205 } |
206 | 206 |
207 } // namespace blink | 207 } // namespace blink |
OLD | NEW |