Changeset 78921


Ignore:
Timestamp:
02/17/11 15:32:56 (4 years ago)
Author:
kbr@google.com
Message:

2011-02-17 Sergey Glazunov <serg.glazunov@gmail.com>

Reviewed by Kenneth Russell.

Null out the WEBKIT_lose_context WebGL extension's context pointer when
the WebGL rendering context is removed.
https://bugs.webkit.org/show_bug.cgi?id=54679

  • fast/canvas/webgl/context-destroyed-crash-expected.txt: Added.
  • fast/canvas/webgl/context-destroyed-crash.html: Added.

2011-02-17 Sergey Glazunov <serg.glazunov@gmail.com>

Reviewed by Kenneth Russell.

Null out the WEBKIT_lose_context WebGL extension's context pointer when
the WebGL rendering context is removed.
https://bugs.webkit.org/show_bug.cgi?id=54679

Test: fast/canvas/webgl/context-destroyed-crash.html

  • html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::~WebGLRenderingContext):
  • html/canvas/WebKitLoseContext.cpp: (WebCore::WebKitLoseContext::loseContext): Add null-check for m_context.
  • html/canvas/WebKitLoseContext.h: (WebCore::WebKitLoseContext::contextDestroyed):
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r78919 r78921  
     12011-02-17  Sergey Glazunov  <serg.glazunov@gmail.com> 
     2 
     3        Reviewed by Kenneth Russell. 
     4 
     5        Null out the WEBKIT_lose_context WebGL extension's context pointer when 
     6        the WebGL rendering context is removed. 
     7        https://bugs.webkit.org/show_bug.cgi?id=54679 
     8 
     9        * fast/canvas/webgl/context-destroyed-crash-expected.txt: Added. 
     10        * fast/canvas/webgl/context-destroyed-crash.html: Added. 
     11 
    1122011-02-17  Kenneth Russell  <kbr@google.com> 
    213 
  • trunk/Source/WebCore/ChangeLog

    r78919 r78921  
     12011-02-17  Sergey Glazunov  <serg.glazunov@gmail.com> 
     2 
     3        Reviewed by Kenneth Russell. 
     4 
     5        Null out the WEBKIT_lose_context WebGL extension's context pointer when 
     6        the WebGL rendering context is removed. 
     7        https://bugs.webkit.org/show_bug.cgi?id=54679 
     8 
     9        Test: fast/canvas/webgl/context-destroyed-crash.html 
     10 
     11        * html/canvas/WebGLRenderingContext.cpp: 
     12        (WebCore::WebGLRenderingContext::~WebGLRenderingContext): 
     13        * html/canvas/WebKitLoseContext.cpp: 
     14        (WebCore::WebKitLoseContext::loseContext): Add null-check for m_context. 
     15        * html/canvas/WebKitLoseContext.h: 
     16        (WebCore::WebKitLoseContext::contextDestroyed): 
     17 
    1182011-02-17  Kenneth Russell  <kbr@google.com> 
    219 
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r78495 r78921  
    462462    detachAndRemoveAllObjects(); 
    463463    m_context->setContextLostCallback(0); 
     464    if (m_webkitLoseContext) 
     465        m_webkitLoseContext->contextDestroyed(); 
    464466} 
    465467 
  • trunk/Source/WebCore/html/canvas/WebKitLoseContext.cpp

    r76600 r78921  
    5656void WebKitLoseContext::loseContext() 
    5757{ 
    58     m_context->forceLostContext(); 
     58    if (m_context) 
     59        m_context->forceLostContext(); 
    5960} 
    6061 
  • trunk/Source/WebCore/html/canvas/WebKitLoseContext.h

    r75271 r78921  
    4343 
    4444    void loseContext(); 
     45    void contextDestroyed() { m_context = 0; } 
    4546 
    4647private: 
Note: See TracChangeset for help on using the changeset viewer.