Title: [262783] branches/safari-609-branch/Source
Revision
262783
Author
[email protected]
Date
2020-06-09 01:50:03 -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

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.

Source/WebCore:

* platform/graphics/GraphicsContext3DManager.cpp: Check the state of the
singleton before calling it.
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
* platform/graphics/mac/SwitchingGPUClient.h: Add a method to check if the
singleton has been set.
(WebCore::SwitchingGPUClient::hasSingleton):

Source/WebKit:

* WebProcess/cocoa/WebProcessCocoa.mm: Set the singleton unconditionally.
(WebKit::WebProcess::platformInitializeProcess):

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (262782 => 262783)


--- branches/safari-609-branch/Source/WebCore/ChangeLog	2020-06-09 08:33:56 UTC (rev 262782)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog	2020-06-09 08:50:03 UTC (rev 262783)
@@ -1,3 +1,22 @@
+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.
+
+        * platform/graphics/GraphicsContext3DManager.cpp: Check the state of the
+        singleton before calling it.
+        (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
+        (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
+        * platform/graphics/mac/SwitchingGPUClient.h: Add a method to check if the
+        singleton has been set.
+        (WebCore::SwitchingGPUClient::hasSingleton):
+
 2020-06-06  Andy Estes  <[email protected]>
 
         Unreviewed build fix for platforms where APPLE_PAY_INSTALLMENTS is disabled.

Modified: branches/safari-609-branch/Source/WebCore/platform/graphics/GraphicsContext3DManager.cpp (262782 => 262783)


--- branches/safari-609-branch/Source/WebCore/platform/graphics/GraphicsContext3DManager.cpp	2020-06-09 08:33:56 UTC (rev 262782)
+++ branches/safari-609-branch/Source/WebCore/platform/graphics/GraphicsContext3DManager.cpp	2020-06-09 08:50:03 UTC (rev 262783)
@@ -236,7 +236,8 @@
             LOG(WebGL, "Request the high-performance GPU.");
             m_requestingHighPerformance = true;
 #if PLATFORM(MAC)
-            SwitchingGPUClient::singleton().requestHighPerformanceGPU();
+            if (SwitchingGPUClient::hasSingleton())
+                SwitchingGPUClient::singleton().requestHighPerformanceGPU();
 #endif
         }
 
@@ -262,7 +263,8 @@
 
     m_requestingHighPerformance = false;
 #if PLATFORM(MAC) && (USE(OPENGL) || USE(ANGLE))
-    SwitchingGPUClient::singleton().releaseHighPerformanceGPU();
+    if (SwitchingGPUClient::hasSingleton())
+        SwitchingGPUClient::singleton().releaseHighPerformanceGPU();
 #endif
 }
 

Modified: branches/safari-609-branch/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h (262782 => 262783)


--- branches/safari-609-branch/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h	2020-06-09 08:33:56 UTC (rev 262782)
+++ branches/safari-609-branch/Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h	2020-06-09 08:50:03 UTC (rev 262783)
@@ -32,6 +32,8 @@
     WEBCORE_EXPORT static SwitchingGPUClient& singleton();
     WEBCORE_EXPORT static void setSingleton(SwitchingGPUClient&);
 
+    static bool hasSingleton() { return !!m_singleton; }
+
     virtual ~SwitchingGPUClient() = default;
 
     virtual void requestHighPerformanceGPU() = 0;

Modified: branches/safari-609-branch/Source/WebKit/ChangeLog (262782 => 262783)


--- branches/safari-609-branch/Source/WebKit/ChangeLog	2020-06-09 08:33:56 UTC (rev 262782)
+++ branches/safari-609-branch/Source/WebKit/ChangeLog	2020-06-09 08:50:03 UTC (rev 262783)
@@ -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-04  Alan Coon  <[email protected]>
 
         Cherry-pick r262196. rdar://problem/63951363

Modified: branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (262782 => 262783)


--- branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-06-09 08:33:56 UTC (rev 262782)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-06-09 08:50:03 UTC (rev 262783)
@@ -508,8 +508,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]) {
@@ -519,6 +517,8 @@
     }
 #endif // ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
 
+    SwitchingGPUClient::setSingleton(WebSwitchingGPUClient::singleton());
+
     m_uiProcessName = parameters.uiProcessName;
 #endif // PLATFORM(MAC)
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to