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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h

Issue 2341043002: webgl: Replace query task observer with a posted task (Closed)
Patch Set: Make sure queries finish Created 4 years, 3 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/webgl/WebGLTimerQueryEXT.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h b/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h
index 1c09661009de54f6154971e48548bf81b4ad87dd..326211c277b0cc505e52707669958c31770a9aa9 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h
@@ -7,7 +7,7 @@
#include "modules/webgl/WebGLContextObject.h"
-#include "public/platform/WebThread.h"
+#include "wtf/WeakPtr.h"
namespace gpu {
namespace gles2 {
@@ -17,7 +17,9 @@ class GLES2Interface;
namespace blink {
-class WebGLTimerQueryEXT : public WebGLContextObject, public WebThread::TaskObserver {
+class WebTaskRunner;
+
+class WebGLTimerQueryEXT : public WebGLContextObject {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -43,20 +45,18 @@ private:
bool hasObject() const override { return m_queryId != 0; }
void deleteObjectImpl(gpu::gles2::GLES2Interface*) override;
- void registerTaskObserver();
- void unregisterTaskObserver();
-
- // TaskObserver implementation.
- void didProcessTask() override;
- void willProcessTask() override { }
+ void scheduleAllowAvailabilityUpdate();
+ void allowAvailabilityUpdate();
GLenum m_target;
GLuint m_queryId;
- bool m_taskObserverRegistered;
bool m_canUpdateAvailability;
bool m_queryResultAvailable;
GLuint64 m_queryResult;
+
+ std::unique_ptr<WebTaskRunner> m_taskRunner;
+ WTF::WeakPtrFactory<WebGLTimerQueryEXT> m_weakFactory;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698