Changeset 262811 in webkit


Ignore:
Timestamp:
Jun 9, 2020 2:19:49 PM (4 years ago)
Author:
dino@apple.com
Message:

REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash
https://bugs.webkit.org/show_bug.cgi?id=212940
Source/WebCore:

rdar://63839405

Reviewed by Tim Horton.

The code to use the singleton for a SwitchingGPUClient was assuming it
has always been set, which was not the case when
ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.

  • platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: Check the state of the

singleton before calling it.
(WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState):
(WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired):

  • platform/graphics/mac/SwitchingGPUClient.h: Return a pointer to the singleton which

will allow the code to check for its existence.
(WebCore::SwitchingGPUClient::singletonIfExists):

Source/WebKit:

Reviewed by Tim Horton.

The code to use the singleton for a SwitchingGPUClient was assuming it
has always been set, which was not the case when
ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.

  • WebProcess/cocoa/WebProcessCocoa.mm: Set the singleton unconditionally.

(WebKit::WebProcess::platformInitializeProcess):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r262810 r262811  
     12020-06-09  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash
     4        https://bugs.webkit.org/show_bug.cgi?id=212940
     5        rdar://63839405
     6
     7        Reviewed by Tim Horton.
     8
     9        The code to use the singleton for a SwitchingGPUClient was assuming it
     10        has always been set, which was not the case when
     11        ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.
     12
     13        * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: Check the state of the
     14        singleton before calling it.
     15        (WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState):
     16        (WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired):
     17        * platform/graphics/mac/SwitchingGPUClient.h: Return a pointer to the singleton which
     18        will allow the code to check for its existence.
     19        (WebCore::SwitchingGPUClient::singletonIfExists):
     20
    1212020-06-09  Sam Weinig  <weinig@apple.com>
    222
  • trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.cpp

    r236773 r262811  
    3131SwitchingGPUClient* SwitchingGPUClient::m_singleton = nullptr;
    3232
    33 SwitchingGPUClient& SwitchingGPUClient::singleton()
     33SwitchingGPUClient* SwitchingGPUClient::singletonIfExists()
    3434{
    35     ASSERT(m_singleton);
    36     return *m_singleton;
     35    return m_singleton;
    3736}
    3837
  • trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h

    r236773 r262811  
    3030class SwitchingGPUClient {
    3131public:
    32     WEBCORE_EXPORT static SwitchingGPUClient& singleton();
     32    WEBCORE_EXPORT static SwitchingGPUClient* singletonIfExists();
    3333    WEBCORE_EXPORT static void setSingleton(SwitchingGPUClient&);
    3434
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp

    r254064 r262811  
    237237            m_requestingHighPerformance = true;
    238238#if PLATFORM(MAC)
    239             SwitchingGPUClient::singleton().requestHighPerformanceGPU();
     239            if (auto* singleton = SwitchingGPUClient::singletonIfExists())
     240                singleton->requestHighPerformanceGPU();
    240241#endif
    241242        }
     
    263264    m_requestingHighPerformance = false;
    264265#if PLATFORM(MAC) && (USE(OPENGL) || USE(ANGLE))
    265     SwitchingGPUClient::singleton().releaseHighPerformanceGPU();
     266    if (auto* singleton = SwitchingGPUClient::singletonIfExists())
     267        singleton->releaseHighPerformanceGPU();
    266268#endif
    267269}
  • trunk/Source/WebKit/ChangeLog

    r262802 r262811  
     12020-06-09  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash
     4        https://bugs.webkit.org/show_bug.cgi?id=212940
     5
     6        Reviewed by Tim Horton.
     7
     8        The code to use the singleton for a SwitchingGPUClient was assuming it
     9        has always been set, which was not the case when
     10        ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.
     11
     12        * WebProcess/cocoa/WebProcessCocoa.mm: Set the singleton unconditionally.
     13        (WebKit::WebProcess::platformInitializeProcess):
     14
    1152020-06-09  Wenson Hsieh  <wenson_hsieh@apple.com>
    216
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r262724 r262811  
    503503    // Make sure that we close any WindowServer connections after checking in with Launch Services.
    504504    CGSShutdownServerConnections();
    505 
    506     SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton());
    507505#else
    508506
     
    513511    }
    514512#endif // ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     513
     514    SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton());
    515515#endif // PLATFORM(MAC)
    516516
Note: See TracChangeset for help on using the changeset viewer.