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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.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
Index: third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp b/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp
index 27e4f1cb9ede32e13bce2bc5af86388018d49ff7..b81eb01ae5b5420e6f8980d3a54cd8c302153419 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp
@@ -29,10 +29,7 @@ WebGLTimerQueryEXT::WebGLTimerQueryEXT(WebGLRenderingContextBase* ctx)
m_queryResult(0),
m_taskRunner(TaskRunnerHelper::get(TaskType::Unthrottled,
&ctx->canvas()->document())
- ->clone()),
- m_cancellableTaskFactory(CancellableTaskFactory::create(
- this,
- &WebGLTimerQueryEXT::allowAvailabilityUpdate)) {
+ ->clone()) {
context()->contextGL()->GenQueriesEXT(1, &m_queryId);
}
@@ -74,7 +71,7 @@ void WebGLTimerQueryEXT::updateCachedResult(gpu::gles2::GLES2Interface* gl) {
GLuint64 result = 0;
gl->GetQueryObjectui64vEXT(object(), GL_QUERY_RESULT_EXT, &result);
m_queryResult = result;
- m_cancellableTaskFactory->cancel();
+ m_taskHandle.cancel();
} else {
scheduleAllowAvailabilityUpdate();
}
@@ -94,9 +91,11 @@ void WebGLTimerQueryEXT::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) {
}
void WebGLTimerQueryEXT::scheduleAllowAvailabilityUpdate() {
- if (!m_cancellableTaskFactory->isPending())
- m_taskRunner->postTask(BLINK_FROM_HERE,
- m_cancellableTaskFactory->cancelAndCreate());
+ if (m_taskHandle.isActive())
+ return;
+ m_taskHandle = m_taskRunner->postCancellableTask(
+ BLINK_FROM_HERE, WTF::bind(&WebGLTimerQueryEXT::allowAvailabilityUpdate,
+ wrapWeakPersistent(this)));
}
void WebGLTimerQueryEXT::allowAvailabilityUpdate() {
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698