Skip to content
Permalink
Browse files
REGRESSION: [Safari Mojave for High Sierra] Accessing some of the fea…
…tured 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):

Canonical link: https://commits.webkit.org/225788@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grorg committed Jun 9, 2020
1 parent 1dc4f88 commit 970883ee62d3a3d1911f7d775ec2090368ecf826
Showing 6 changed files with 43 additions and 8 deletions.
@@ -1,3 +1,23 @@
2020-06-09 Dean Jackson <dino@apple.com>

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
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):

2020-06-09 Sam Weinig <weinig@apple.com>

Extended Color: Streamline SimpleColor premulitply/unpremultiply code
@@ -30,10 +30,9 @@ namespace WebCore {

SwitchingGPUClient* SwitchingGPUClient::m_singleton = nullptr;

SwitchingGPUClient& SwitchingGPUClient::singleton()
SwitchingGPUClient* SwitchingGPUClient::singletonIfExists()
{
ASSERT(m_singleton);
return *m_singleton;
return m_singleton;
}

void SwitchingGPUClient::setSingleton(SwitchingGPUClient& singleton)
@@ -29,7 +29,7 @@ namespace WebCore {

class SwitchingGPUClient {
public:
WEBCORE_EXPORT static SwitchingGPUClient& singleton();
WEBCORE_EXPORT static SwitchingGPUClient* singletonIfExists();
WEBCORE_EXPORT static void setSingleton(SwitchingGPUClient&);

virtual ~SwitchingGPUClient() = default;
@@ -236,7 +236,8 @@ void GraphicsContextGLOpenGLManager::updateHighPerformanceState()
LOG(WebGL, "Request the high-performance GPU.");
m_requestingHighPerformance = true;
#if PLATFORM(MAC)
SwitchingGPUClient::singleton().requestHighPerformanceGPU();
if (auto* singleton = SwitchingGPUClient::singletonIfExists())
singleton->requestHighPerformanceGPU();
#endif
}

@@ -262,7 +263,8 @@ void GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired()

m_requestingHighPerformance = false;
#if PLATFORM(MAC) && (USE(OPENGL) || USE(ANGLE))
SwitchingGPUClient::singleton().releaseHighPerformanceGPU();
if (auto* singleton = SwitchingGPUClient::singletonIfExists())
singleton->releaseHighPerformanceGPU();
#endif
}

@@ -1,3 +1,17 @@
2020-06-09 Dean Jackson <dino@apple.com>

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

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):

2020-06-09 Wenson Hsieh <wenson_hsieh@apple.com>

REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
@@ -502,8 +502,6 @@ static void registerWithAccessibility()
RELEASE_ASSERT(retval == kCGErrorSuccess);
// Make sure that we close any WindowServer connections after checking in with Launch Services.
CGSShutdownServerConnections();

SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton());
#else

if (![NSApp isRunning]) {
@@ -512,6 +510,8 @@ static void registerWithAccessibility()
launchServicesCheckIn();
}
#endif // ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)

SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton());
#endif // PLATFORM(MAC)

if (parameters.extraInitializationData.get("inspector-process"_s) == "1")

0 comments on commit 970883e

Please sign in to comment.