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

Unified Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

Issue 214963003: Ensured that any failure to create a WebGL context dispatches a webglcontextcreationerror (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed feeback Created 6 years, 9 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 | « Source/core/html/HTMLCanvasElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContext.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 190ad7665c36387dcef80c6a83105d05ed2cca59..b0f5542b7474a719a86b938f0546fda843465889 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -62,8 +62,10 @@ PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElemen
{
Document& document = canvas->document();
LocalFrame* frame = document.frame();
- if (!frame)
+ if (!frame) {
+ canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Web page was not allowed to create a WebGL context."));
return nullptr;
+ }
Settings* settings = frame->settings();
// The FrameLoaderClient might block creation of a new WebGL context despite the page settings; in
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698