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

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

Issue 2411703004: Add usage counter to OffscreenCanvas API calls (Closed)
Patch Set: fix compile error Created 4 years, 2 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/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 9b5a32a926721604ab78060ba166c20317ff8f9c..3d4bc1c7f612782ff5387b4a16f7907d44d9f412 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -678,13 +678,20 @@ void WebGLRenderingContextBase::forceNextWebGLContextCreationToFail() {
shouldFailContextCreationForTesting = true;
}
-ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase() {
+ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase(
+ ScriptState* scriptState) {
+ UseCounter::Feature feature =
+ UseCounter::OffscreenCanvasTransferToImageBitmapWebGL;
+ UseCounter::count(scriptState->getExecutionContext(), feature);
if (!drawingBuffer())
return nullptr;
return ImageBitmap::create(drawingBuffer()->transferToStaticBitmapImage());
}
-void WebGLRenderingContextBase::commit(ExceptionState& exceptionState) {
+void WebGLRenderingContextBase::commit(ScriptState* scriptState,
+ ExceptionState& exceptionState) {
+ UseCounter::Feature feature = UseCounter::OffscreenCanvasCommitWebGL;
+ UseCounter::count(scriptState->getExecutionContext(), feature);
if (!getOffscreenCanvas()) {
exceptionState.throwDOMException(InvalidStateError,
"Commit() was called on a rendering "

Powered by Google App Engine
This is Rietveld 408576698