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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLQuery.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/WebGLQuery.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLQuery.cpp b/third_party/WebKit/Source/modules/webgl/WebGLQuery.cpp
index f1084303c7a59003e14fb61813f0b91dd6566187..89cd092d32da430ac68567c03bfdd8e750e8800e 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLQuery.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLQuery.cpp
@@ -28,10 +28,7 @@ WebGLQuery::WebGLQuery(WebGL2RenderingContextBase* ctx)
m_queryResult(0),
m_taskRunner(TaskRunnerHelper::get(TaskType::Unthrottled,
&ctx->canvas()->document())
- ->clone()),
- m_cancellableTaskFactory(CancellableTaskFactory::create(
- this,
- &WebGLQuery::allowAvailabilityUpdate)) {
+ ->clone()) {
GLuint query;
ctx->contextGL()->GenQueriesEXT(1, &query);
setObject(query);
@@ -77,7 +74,7 @@ void WebGLQuery::updateCachedResult(gpu::gles2::GLES2Interface* gl) {
GLuint result = 0;
gl->GetQueryObjectuivEXT(object(), GL_QUERY_RESULT_EXT, &result);
m_queryResult = result;
- m_cancellableTaskFactory->cancel();
+ m_taskHandle.cancel();
} else {
scheduleAllowAvailabilityUpdate();
}
@@ -92,9 +89,11 @@ GLuint WebGLQuery::getQueryResult() {
}
void WebGLQuery::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(&WebGLQuery::allowAvailabilityUpdate,
+ wrapWeakPersistent(this)));
}
void WebGLQuery::allowAvailabilityUpdate() {
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLQuery.h ('k') | third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698