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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationConnection.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/presentation/PresentationConnection.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
index 8de73c9597708d1eab3610dcf2aebe3f174800d2..a2b2034ecffc69b55bd380c9206d0ed2dd64f9a2 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
@@ -9,7 +9,6 @@
#include "core/dom/DOMArrayBufferView.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
-#include "core/dom/ExecutionContextTask.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/events/Event.h"
#include "core/events/MessageEvent.h"
@@ -204,9 +203,9 @@ PresentationConnection* PresentationConnection::take(
// Fire onconnectionavailable event asynchronously.
auto* event = PresentationConnectionAvailableEvent::create(
EventTypeNames::connectionavailable, connection);
- request->getExecutionContext()->postTask(
- TaskType::Presentation, BLINK_FROM_HERE,
- createSameThreadTask(&PresentationConnection::dispatchEventAsync,
+ TaskRunnerHelper::get(TaskType::Presentation, request->getExecutionContext())
+ ->postTask(BLINK_FROM_HERE,
+ WTF::bind(&PresentationConnection::dispatchEventAsync,
wrapPersistent(request), wrapPersistent(event)));
return connection;
@@ -488,9 +487,9 @@ void PresentationConnection::didFailLoadingBlob(
}
void PresentationConnection::dispatchStateChangeEvent(Event* event) {
- getExecutionContext()->postTask(
- TaskType::Presentation, BLINK_FROM_HERE,
- createSameThreadTask(&PresentationConnection::dispatchEventAsync,
+ TaskRunnerHelper::get(TaskType::Presentation, getExecutionContext())
+ ->postTask(BLINK_FROM_HERE,
+ WTF::bind(&PresentationConnection::dispatchEventAsync,
wrapPersistent(this), wrapPersistent(event)));
}

Powered by Google App Engine
This is Rietveld 408576698