Skip to content

Commit

Permalink
Remove remaining WebGL diagnostic logging
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264347
rdar://118066101

Reviewed by Dan Glastonbury.

This removes the remaining pieces of WebGL diagnostic logging, in
particular for context loss and some remaining constants.

* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::checkForContextLossHandling): Deleted.
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey): Deleted.
(WebCore::DiagnosticLoggingKeys::inactiveKey): Deleted.
(WebCore::DiagnosticLoggingKeys::activeInForegroundTabKey): Deleted.
(WebCore::DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey): Deleted.
* Source/WebCore/page/DiagnosticLoggingKeys.h:

Canonical link: https://commits.webkit.org/270380@main
  • Loading branch information
annevk committed Nov 8, 2023
1 parent 17d1d74 commit 699f679
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 49 deletions.
22 changes: 0 additions & 22 deletions Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,13 +659,10 @@ WebGLRenderingContextBase::WebGLRenderingContextBase(CanvasBase& canvas, WebGLCo
, m_generatedImageCache(4)
, m_attributes(attributes)
, m_numGLErrorsToConsoleAllowed(canvas.scriptExecutionContext()->settingsValues().webGLErrorsToConsoleEnabled ? maxGLErrorsAllowedToConsole : 0)
, m_checkForContextLossHandlingTimer(*this, &WebGLRenderingContextBase::checkForContextLossHandling)
#if ENABLE(WEBXR)
, m_isXRCompatible(attributes.xrCompatible)
#endif
{
if (htmlCanvas())
m_checkForContextLossHandlingTimer.startOneShot(checkContextLossHandlingDelay);
}

WebGLCanvas WebGLRenderingContextBase::canvas()
Expand All @@ -688,25 +685,6 @@ OffscreenCanvas* WebGLRenderingContextBase::offscreenCanvas()
}
#endif

// We check for context loss handling after a few seconds to give the JS a chance to register the event listeners
// and to discard temporary GL contexts (e.g. feature detection).
void WebGLRenderingContextBase::checkForContextLossHandling()
{
auto* canvas = htmlCanvas();
if (!canvas)
return;

if (!canvas->renderer())
return;

auto* page = canvas->document().page();
if (!page)
return;

bool handlesContextLoss = canvas->hasEventListeners(eventNames().webglcontextlostEvent) && canvas->hasEventListeners(eventNames().webglcontextrestoredEvent);
page->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey(), handlesContextLoss ? DiagnosticLoggingKeys::yesKey() : DiagnosticLoggingKeys::noKey(), ShouldSample::No);
}

void WebGLRenderingContextBase::initializeNewContext(Ref<GraphicsContextGL> context)
{
bool wasActive = m_context;
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,6 @@ class WebGLRenderingContextBase : public GraphicsContextGL::Client, public GPUBa
void maybeRestoreContextSoon(Seconds timeout = 0_s);
void maybeRestoreContext();

void checkForContextLossHandling();

void activityStateDidChange(OptionSet<ActivityState> oldActivityState, OptionSet<ActivityState> newActivityState) override;

ExceptionOr<void> texImageSource(TexImageFunctionID, GCGLenum target, GCGLint level, GCGLint internalformat, GCGLint border, GCGLenum format, GCGLenum type, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, const IntRect& inputSourceImageRect, GCGLsizei depth, GCGLint unpackImageHeight, ImageBitmap& source);
Expand All @@ -1029,7 +1027,6 @@ class WebGLRenderingContextBase : public GraphicsContextGL::Client, public GPUBa
ExceptionOr<void> texImageSource(TexImageFunctionID, GCGLenum target, GCGLint level, GCGLint internalformat, GCGLint border, GCGLenum format, GCGLenum type, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, const IntRect& inputSourceImageRect, GCGLsizei depth, GCGLint unpackImageHeight, WebCodecsVideoFrame& source);
#endif

Timer m_checkForContextLossHandlingTimer;
bool m_isSuspended { false };

#if ENABLE(WEBXR)
Expand Down
20 changes: 0 additions & 20 deletions Source/WebCore/page/DiagnosticLoggingKeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ String DiagnosticLoggingKeys::postPageBackgroundingMemoryUsageKey()
return "postPageBackgroundingMemoryUsage"_s;
}

String DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey()
{
return "pageHandlesWebGLContextLoss"_s;
}

String DiagnosticLoggingKeys::postPageLoadCPUUsageKey()
{
return "postPageLoadCPUUsage"_s;
Expand Down Expand Up @@ -233,11 +228,6 @@ String DiagnosticLoggingKeys::imageKey()
return "image"_s;
}

String DiagnosticLoggingKeys::inactiveKey()
{
return "inactive"_s;
}

String DiagnosticLoggingKeys::internalErrorKey()
{
return "internalError"_s;
Expand Down Expand Up @@ -348,16 +338,6 @@ String DiagnosticLoggingKeys::createSharedBufferFailedKey()
return "createSharedBufferFailed"_s;
}

String DiagnosticLoggingKeys::activeInForegroundTabKey()
{
return "activeInForegroundTab"_s;
}

String DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey()
{
return "activeInBackgroundTabOnly"_s;
}

String DiagnosticLoggingKeys::applicationCacheKey()
{
return "applicationCache"_s;
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/page/DiagnosticLoggingKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ namespace WebCore {

class DiagnosticLoggingKeys {
public:
WEBCORE_EXPORT static String activeInForegroundTabKey();
WEBCORE_EXPORT static String activeInBackgroundTabOnlyKey();
static String applicationCacheKey();
#if ENABLE(APPLICATION_MANIFEST)
static String applicationManifestKey();
Expand Down Expand Up @@ -77,7 +75,6 @@ class DiagnosticLoggingKeys {
static String fontKey();
static String httpsNoStoreKey();
static String imageKey();
WEBCORE_EXPORT static String inactiveKey();
WEBCORE_EXPORT static String internalErrorKey();
WEBCORE_EXPORT static String invalidSessionIDKey();
WEBCORE_EXPORT static String isAttachmentKey();
Expand Down Expand Up @@ -115,7 +112,6 @@ class DiagnosticLoggingKeys {
static String visuallyEmptyKey();
static String pageContainsAtLeastOneMediaEngineKey();
static String pageContainsMediaEngineKey();
static String pageHandlesWebGLContextLossKey();
static String pageLoadedKey();
static String playedKey();
static String postPageBackgroundingCPUUsageKey();
Expand Down

0 comments on commit 699f679

Please sign in to comment.