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

Unified Diff: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp

Issue 2514733002: Scheduler: Deprecate CancellableTaskFactory in favor of WebTaskRunner::postCancellableTask (3) (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
diff --git a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
index e405c7201cd4c9dec966accddd4dc9304c7f9a89..24f2559637a239ebb4caa19b377dd37d0702fc96 100644
--- a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
+++ b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
@@ -9,7 +9,6 @@
#include "core/frame/Settings.h"
#include "core/page/Page.h"
#include "platform/geometry/DoubleRect.h"
-#include "platform/scheduler/CancellableTaskFactory.h"
#include "public/platform/Platform.h"
#include "public/platform/WebFloatPoint.h"
#include "public/platform/WebThread.h"
@@ -39,11 +38,7 @@ InspectorEmulationAgent* InspectorEmulationAgent::create(
InspectorEmulationAgent::InspectorEmulationAgent(
WebLocalFrameImpl* webLocalFrameImpl,
Client* client)
- : m_webLocalFrameImpl(webLocalFrameImpl),
- m_client(client),
- m_virtualTimeBudgetExpiredTask(CancellableTaskFactory::create(
- this,
- &InspectorEmulationAgent::virtualTimeBudgetExpired)) {}
+ : m_webLocalFrameImpl(webLocalFrameImpl), m_client(client) {}
InspectorEmulationAgent::~InspectorEmulationAgent() {}
@@ -158,9 +153,12 @@ Response InspectorEmulationAgent::setVirtualTimePolicy(const String& policy,
WebTaskRunner* taskRunner =
Platform::current()->currentThread()->getWebTaskRunner();
long long delayMillis = static_cast<long long>(budget.fromJust());
- taskRunner->postDelayedTask(
- BLINK_FROM_HERE, m_virtualTimeBudgetExpiredTask->cancelAndCreate(),
- delayMillis);
+ m_virtualTimeBudgetExpiredTaskHandle =
+ taskRunner->postDelayedCancellableTask(
+ BLINK_FROM_HERE,
+ WTF::bind(&InspectorEmulationAgent::virtualTimeBudgetExpired,
+ wrapWeakPersistent(this)),
+ delayMillis);
}
return Response::OK();
}
« no previous file with comments | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698