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

Unified Diff: Source/core/css/FontFaceSet.h

Issue 27571005: Replace Timers used in ActiveDOMObject with AsyncMethodRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/FontFaceSet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontFaceSet.h
diff --git a/Source/core/css/FontFaceSet.h b/Source/core/css/FontFaceSet.h
index 6a5234919b45de1049ec450f21eeff4a311519b2..0d444323d5bcb65942e24c19f0d4803bfc2e0997 100644
--- a/Source/core/css/FontFaceSet.h
+++ b/Source/core/css/FontFaceSet.h
@@ -32,7 +32,7 @@
#include "core/events/EventListener.h"
#include "core/events/EventTarget.h"
#include "core/events/ThreadLocalEventNames.h"
-#include "platform/Timer.h"
+#include "platform/AsyncMethodRunner.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
@@ -86,6 +86,11 @@ public:
void loadError(FontFace*);
void scheduleResolve(LoadFontPromiseResolver*);
+ // ActiveDOMObject
+ virtual void suspend() OVERRIDE;
+ virtual void resume() OVERRIDE;
+ virtual void stop() OVERRIDE;
+
private:
class FontLoadHistogram {
public:
@@ -106,7 +111,8 @@ private:
void resolvePendingLoadPromises();
void fireDoneEventIfPossible();
bool resolveFontStyle(const String&, Font&);
- void timerFired(Timer<FontFaceSet>*);
+ void handlePendingEventsAndPromisesSoon();
+ void handlePendingEventsAndPromises();
unsigned m_loadingCount;
Vector<RefPtr<Event> > m_pendingEvents;
@@ -115,7 +121,9 @@ private:
FontFaceArray m_loadedFonts;
FontFaceArray m_failedFonts;
bool m_shouldFireDoneEvent;
- Timer<FontFaceSet> m_timer;
+
+ AsyncMethodRunner<FontFaceSet> m_asyncRunner;
+
FontLoadHistogram m_histogram;
};
« no previous file with comments | « no previous file | Source/core/css/FontFaceSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698