Index: third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp |
diff --git a/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp b/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp |
index ab70f6598b9e000089e4166b3922f10296254bf4..e014e49f24f243ffc15f43e555d462b530337018 100644 |
--- a/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp |
+++ b/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp |
@@ -35,6 +35,9 @@ |
#include "core/dom/Element.h" |
#include "core/html/HTMLInputElement.h" |
#include "platform/Timer.h" |
+#include "public/platform/Platform.h" |
+#include "public/platform/WebScheduler.h" |
+#include "public/platform/WebThread.h" |
#include "wtf/HashFunctions.h" |
#include "wtf/HashMap.h" |
#include "wtf/text/CString.h" |
@@ -76,6 +79,9 @@ static PresentationAttributeCache& presentationAttributeCache() { |
return cache; |
} |
+// This is a singleton (held via DEFINE_STATIC_LOCAL). |
+// Thus it is appropriate to use the main thread's timer task runner, rather |
+// than one associated with a particular frame. |
class PresentationAttributeCacheCleaner { |
WTF_MAKE_NONCOPYABLE(PresentationAttributeCacheCleaner); |
USING_FAST_MALLOC(PresentationAttributeCacheCleaner); |
@@ -83,7 +89,10 @@ class PresentationAttributeCacheCleaner { |
public: |
PresentationAttributeCacheCleaner() |
: m_hitCount(0), |
- m_cleanTimer(this, &PresentationAttributeCacheCleaner::cleanCache) {} |
+ m_cleanTimer( |
+ Platform::current()->mainThread()->scheduler()->timerTaskRunner(), |
+ this, |
+ &PresentationAttributeCacheCleaner::cleanCache) {} |
void didHitPresentationAttributeCache() { |
if (presentationAttributeCache().size() < |
@@ -113,7 +122,7 @@ class PresentationAttributeCacheCleaner { |
} |
unsigned m_hitCount; |
- Timer<PresentationAttributeCacheCleaner> m_cleanTimer; |
+ TaskRunnerTimer<PresentationAttributeCacheCleaner> m_cleanTimer; |
}; |
static bool attributeNameSort(const std::pair<StringImpl*, AtomicString>& p1, |