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

Side by Side Diff: Source/core/dom/PresentationAttributeStyle.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/MainThreadTaskRunner.cpp ('k') | Source/core/dom/ScriptRunner.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) 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 void didHitPresentationAttributeCache() 82 void didHitPresentationAttributeCache()
83 { 83 {
84 if (presentationAttributeCache().size() < minimumPresentationAttributeCa cheSizeForCleaning) 84 if (presentationAttributeCache().size() < minimumPresentationAttributeCa cheSizeForCleaning)
85 return; 85 return;
86 86
87 m_hitCount++; 87 m_hitCount++;
88 88
89 if (!m_cleanTimer.isActive()) 89 if (!m_cleanTimer.isActive())
90 m_cleanTimer.startOneShot(presentationAttributeCacheCleanTimeInSecon ds); 90 m_cleanTimer.startOneShot(presentationAttributeCacheCleanTimeInSecon ds, FROM_HERE);
91 } 91 }
92 92
93 private: 93 private:
94 static const unsigned presentationAttributeCacheCleanTimeInSeconds = 60; 94 static const unsigned presentationAttributeCacheCleanTimeInSeconds = 60;
95 static const unsigned minimumPresentationAttributeCacheSizeForCleaning = 100 ; 95 static const unsigned minimumPresentationAttributeCacheSizeForCleaning = 100 ;
96 static const unsigned minimumPresentationAttributeCacheHitCountPerMinute = ( 100 * presentationAttributeCacheCleanTimeInSeconds) / 60; 96 static const unsigned minimumPresentationAttributeCacheHitCountPerMinute = ( 100 * presentationAttributeCacheCleanTimeInSeconds) / 60;
97 97
98 void cleanCache(Timer<PresentationAttributeCacheCleaner>* timer) 98 void cleanCache(Timer<PresentationAttributeCacheCleaner>* timer)
99 { 99 {
100 ASSERT_UNUSED(timer, timer == &m_cleanTimer); 100 ASSERT_UNUSED(timer, timer == &m_cleanTimer);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 presentationAttributeCache().clear(); 199 presentationAttributeCache().clear();
200 presentationAttributeCache().set(cacheHash, newEntry.release()); 200 presentationAttributeCache().set(cacheHash, newEntry.release());
201 } else { 201 } else {
202 cacheValue->value = newEntry.release(); 202 cacheValue->value = newEntry.release();
203 } 203 }
204 204
205 return style.release(); 205 return style.release();
206 } 206 }
207 207
208 } // namespace WebCore 208 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/MainThreadTaskRunner.cpp ('k') | Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698