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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2668573002: Migrate WebGL timers to TaskRunnerTimer (Closed)
Patch Set: add comment Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.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/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 247958978cea2a5563e6c6e13d3fe4bc99620bb8..c6ead75a261a894e5bbd78daa58afaef77f07e8d 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -34,6 +34,7 @@
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMTypedArray.h"
#include "core/dom/FlexibleArrayBufferView.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/frame/ImageBitmap.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
@@ -1039,26 +1040,32 @@ WebGLRenderingContextBase::WebGLRenderingContextBase(
std::unique_ptr<WebGraphicsContext3DProvider> contextProvider,
const CanvasContextCreationAttributes& requestedAttributes,
unsigned version)
- : WebGLRenderingContextBase(nullptr,
- passedOffscreenCanvas,
- std::move(contextProvider),
- requestedAttributes,
- version) {}
+ : WebGLRenderingContextBase(
+ nullptr,
+ passedOffscreenCanvas,
+ TaskRunnerHelper::get(TaskType::WebGL,
+ passedOffscreenCanvas->getExecutionContext()),
+ std::move(contextProvider),
+ requestedAttributes,
+ version) {}
WebGLRenderingContextBase::WebGLRenderingContextBase(
HTMLCanvasElement* passedCanvas,
std::unique_ptr<WebGraphicsContext3DProvider> contextProvider,
const CanvasContextCreationAttributes& requestedAttributes,
unsigned version)
- : WebGLRenderingContextBase(passedCanvas,
- nullptr,
- std::move(contextProvider),
- requestedAttributes,
- version) {}
+ : WebGLRenderingContextBase(
+ passedCanvas,
+ nullptr,
+ TaskRunnerHelper::get(TaskType::WebGL, &passedCanvas->document()),
+ std::move(contextProvider),
+ requestedAttributes,
+ version) {}
WebGLRenderingContextBase::WebGLRenderingContextBase(
HTMLCanvasElement* passedCanvas,
OffscreenCanvas* passedOffscreenCanvas,
+ RefPtr<WebTaskRunner> taskRunner,
std::unique_ptr<WebGraphicsContext3DProvider> contextProvider,
const CanvasContextCreationAttributes& requestedAttributes,
unsigned version)
@@ -1070,10 +1077,13 @@ WebGLRenderingContextBase::WebGLRenderingContextBase(
m_contextLostMode(NotLostContext),
m_autoRecoveryMethod(Manual),
m_dispatchContextLostEventTimer(
+ taskRunner,
this,
&WebGLRenderingContextBase::dispatchContextLostEvent),
m_restoreAllowed(false),
- m_restoreTimer(this, &WebGLRenderingContextBase::maybeRestoreContext),
+ m_restoreTimer(taskRunner,
+ this,
+ &WebGLRenderingContextBase::maybeRestoreContext),
m_boundArrayBuffer(this, nullptr),
m_boundVertexArrayObject(this, nullptr),
m_currentProgram(this, nullptr),
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698