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

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

Issue 2698153003: Reduce createSameThreadTask usage in modules/ (Closed)
Patch Set: Move a static callback to an anonymous namespace Created 3 years, 10 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: third_party/WebKit/Source/modules/notifications/Notification.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp
index 7d110ddc04fd3142cd5082837d45487706b05462..73f85c47a6a31b6bfc53c52291afcbfed1c72740 100644
--- a/third_party/WebKit/Source/modules/notifications/Notification.cpp
+++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -37,7 +37,6 @@
#include "core/dom/Document.h"
#include "core/dom/DocumentUserGestureToken.h"
#include "core/dom/ExecutionContext.h"
-#include "core/dom/ExecutionContextTask.h"
#include "core/dom/ScopedWindowFocusAllowedIndicator.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/events/Event.h"
@@ -185,10 +184,9 @@ void Notification::close() {
// Schedule the "close" event to be fired for non-persistent notifications.
// Persistent notifications won't get such events for programmatic closes.
if (m_type == Type::NonPersistent) {
- getExecutionContext()->postTask(
- TaskType::UserInteraction, BLINK_FROM_HERE,
- createSameThreadTask(&Notification::dispatchCloseEvent,
- wrapPersistent(this)));
+ TaskRunnerHelper::get(TaskType::UserInteraction, getExecutionContext())
+ ->postTask(BLINK_FROM_HERE, WTF::bind(&Notification::dispatchCloseEvent,
+ wrapPersistent(this)));
m_state = State::Closing;
notificationManager()->close(this);

Powered by Google App Engine
This is Rietveld 408576698