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

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
Index: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index abee7083931c897faebff4bc7d3bdbd4f93775b7..bfeb9c434d8c7c46d987cc00fb011fbe8361d98a 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -1,3 +1,4 @@
+
abarth-chromium 2013/10/22 18:46:51 supurious?
tyoshino (SeeGerritForStatus) 2013/10/23 06:02:30 oh, mistake. removed
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
* Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved.
@@ -87,14 +88,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 +208,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();
}

Powered by Google App Engine
This is Rietveld 408576698