Title: [262811] trunk/Source
Revision
262811
Author
[email protected]
Date
2020-06-09 14:19:49 -0700 (Tue, 09 Jun 2020)

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (262810 => 262811)


--- trunk/Source/WebCore/ChangeLog	2020-06-09 21:05:09 UTC (rev 262810)
+++ trunk/Source/WebCore/ChangeLog	2020-06-09 21:19:49 UTC (rev 262811)
@@ -1,3 +1,23 @@
+2020-06-09  Dean Jackson  <[email protected]>
+
+        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  <[email protected]>
 
         Extended Color: Streamline SimpleColor premulitply/unpremultiply code

Modified: trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.cpp (262810 => 262811)


--- trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.cpp	2020-06-09 21:05:09 UTC (rev 262810)
+++ trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.cpp	2020-06-09 21:19:49 UTC (rev 262811)
@@ -30,10 +30,9 @@
 
 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)

Modified: trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h (262810 => 262811)


--- trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h	2020-06-09 21:05:09 UTC (rev 262810)
+++ trunk/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h	2020-06-09 21:19:49 UTC (rev 262811)
@@ -29,7 +29,7 @@
 
 class SwitchingGPUClient {
 public:
-    WEBCORE_EXPORT static SwitchingGPUClient& singleton();
+    WEBCORE_EXPORT static SwitchingGPUClient* singletonIfExists();
     WEBCORE_EXPORT static void setSingleton(SwitchingGPUClient&);
 
     virtual ~SwitchingGPUClient() = default;

Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp (262810 => 262811)


--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp	2020-06-09 21:05:09 UTC (rev 262810)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp	2020-06-09 21:19:49 UTC (rev 262811)
@@ -236,7 +236,8 @@
             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 @@
 
     m_requestingHighPerformance = false;
 #if PLATFORM(MAC) && (USE(OPENGL) || USE(ANGLE))
-    SwitchingGPUClient::singleton().releaseHighPerformanceGPU();
+    if (auto* singleton = SwitchingGPUClient::singletonIfExists())
+        singleton->releaseHighPerformanceGPU();
 #endif
 }
 

Modified: trunk/Source/WebKit/ChangeLog (262810 => 262811)


--- trunk/Source/WebKit/ChangeLog	2020-06-09 21:05:09 UTC (rev 262810)
+++ trunk/Source/WebKit/ChangeLog	2020-06-09 21:19:49 UTC (rev 262811)
@@ -1,3 +1,17 @@
+2020-06-09  Dean Jackson  <[email protected]>
+
+        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  <[email protected]>
 
         REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (262810 => 262811)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-06-09 21:05:09 UTC (rev 262810)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-06-09 21:19:49 UTC (rev 262811)
@@ -502,8 +502,6 @@
     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 @@
         launchServicesCheckIn();
     }
 #endif // ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
+
+    SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton());
 #endif // PLATFORM(MAC)
 
     if (parameters.extraInitializationData.get("inspector-process"_s) == "1")
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to