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

Unified Diff: Source/modules/notifications/Notification.cpp

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 | « Source/modules/notifications/Notification.h ('k') | Source/modules/websockets/WebSocket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index abee7083931c897faebff4bc7d3bdbd4f93775b7..4db5fa9a0e06b2373127c761da61192b8ec95747 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -87,14 +87,14 @@ Notification::Notification(ExecutionContext* context, const String& title)
: ActiveDOMObject(context)
, m_title(title)
, m_state(Idle)
- , m_taskTimer(adoptPtr(new Timer<Notification>(this, &Notification::taskTimerFired)))
+ , m_asyncRunner(adoptPtr(new AsyncMethodRunner<Notification>(this, &Notification::showSoon)))
{
ScriptWrappable::init(this);
m_notificationClient = NotificationController::clientFrom(toDocument(context)->page());
ASSERT(m_notificationClient);
- m_taskTimer->startOneShot(0);
+ m_asyncRunner->runAsync();
}
Notification::~Notification()
@@ -207,10 +207,9 @@ void Notification::dispatchErrorEvent()
dispatchEvent(Event::create(EventTypeNames::error));
}
-void Notification::taskTimerFired(Timer<Notification>* timer)
+void Notification::showSoon()
{
ASSERT(executionContext()->isDocument());
- ASSERT_UNUSED(timer, timer == m_taskTimer.get());
show();
}
« no previous file with comments | « Source/modules/notifications/Notification.h ('k') | Source/modules/websockets/WebSocket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698