Title: [107358] trunk/Source/WebCore
Revision
107358
Author
[email protected]
Date
2012-02-09 21:58:51 -0800 (Thu, 09 Feb 2012)

Log Message

Make WebGLRenderingContext::printWarningToConsole safer
https://bugs.webkit.org/show_bug.cgi?id=78284

Patch by Gregg Tavares <[email protected]> on 2012-02-09
Reviewed by Kenneth Russell.

No new tests because no change in functionality.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::printWarningToConsole):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107357 => 107358)


--- trunk/Source/WebCore/ChangeLog	2012-02-10 05:51:57 UTC (rev 107357)
+++ trunk/Source/WebCore/ChangeLog	2012-02-10 05:58:51 UTC (rev 107358)
@@ -1,3 +1,16 @@
+2012-02-09  Gregg Tavares  <[email protected]>
+
+        Make WebGLRenderingContext::printWarningToConsole safer
+        https://bugs.webkit.org/show_bug.cgi?id=78284
+
+        Reviewed by Kenneth Russell.
+
+        No new tests because no change in functionality.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore):
+        (WebCore::WebGLRenderingContext::printWarningToConsole):
+
 2012-02-09  W. James MacLean  <[email protected]>
 
         [chromium] Add support for starting page/scale animations on CC impl thread from WebViewImpl

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (107357 => 107358)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2012-02-10 05:51:57 UTC (rev 107357)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2012-02-10 05:58:51 UTC (rev 107358)
@@ -4890,7 +4890,21 @@
 
 void WebGLRenderingContext::printWarningToConsole(const String& message)
 {
-    canvas()->document()->frame()->domWindow()->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message, canvas()->document()->url().string());
+    if (!canvas())
+        return;
+    Document* document = canvas()->document();
+    if (!document)
+        return;
+    Frame* frame = document->frame();
+    if (!frame)
+        return;
+    DOMWindow* window = frame->domWindow();
+    if (!window)
+        return;
+    Console* console = window->console();
+    if (!console)
+        return;
+    console->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, message, document->url().string());
 }
 
 bool WebGLRenderingContext::validateFramebufferFuncParameters(const char* functionName, GC3Denum target, GC3Denum attachment)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to