Bug 132833

Summary: Limit number of active graphics contexts per web process
Product: WebKit Reporter: Roger Fong <roger_fong>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, esprehn+autocc, gyuyoung.kim, kondapallykalyan, roger_fong, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
better patch dino: review+

Description Roger Fong 2014-05-12 13:16:30 PDT
We will limit number of active WebGL contexts per webprocess to 16.
This should essentially be thought of as your machine running out of resources after 16 contexts are active.
Comment 1 Radar WebKit Bug Importer 2014-05-12 13:23:14 PDT
<rdar://problem/16888465>
Comment 2 Roger Fong 2014-05-12 13:26:51 PDT
Actually this: <rdar://problem/16888459>
Comment 3 Roger Fong 2014-05-12 15:12:43 PDT
Created attachment 231330 [details]
patch
Comment 4 Roger Fong 2014-05-12 17:15:36 PDT
Created attachment 231349 [details]
better patch
Comment 5 Dean Jackson 2014-05-12 17:25:01 PDT
Comment on attachment 231349 [details]
better patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231349&action=review

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:118
> +        return 0;

return nullptr;

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:123
> +        return 0;

return nullptr;

> LayoutTests/webgl/many-contexts.html:13
> +	for (var i = 0; i < size; i++) {
> +		canvii[i] = document.createElement("canvas");
> +		canvii[i].width = 1;
> +		canvii[i].height = 1;
> +		var context = canvii[i].getContext("webgl", null);
> +	}

Weird indentation.

Also, I wonder if we should check that context == null at 1000 (assuming that we might raise the number above 16, but never to 1000).
Comment 6 Roger Fong 2014-05-12 18:11:55 PDT
Committed http://trac.webkit.org/changeset/168666 with fixes.