Bug 132833 - Limit number of active graphics contexts per web process
Summary: Limit number of active graphics contexts per web process
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-12 13:16 PDT by Roger Fong
Modified: 2014-05-12 18:11 PDT (History)
7 users (show)

See Also:


Attachments
patch (4.21 KB, patch)
2014-05-12 15:12 PDT, Roger Fong
no flags Details | Formatted Diff | Diff
better patch (4.54 KB, patch)
2014-05-12 17:15 PDT, Roger Fong
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.