Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2018 23:26:39 +0000 (23:26 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2018 23:26:39 +0000 (23:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185451
<rdar://problem/39620348>

Reviewed by Zalan Bujtas.

Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
PlatformScreenMac implementation to less expensive Debug ASSERTS.

No change in behavior.

* platform/mac/PlatformScreenMac.mm:
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231520 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/PlatformScreenMac.mm

index ae3f886..d351f8f 100644 (file)
@@ -1,3 +1,26 @@
+2018-05-08  Brent Fulgham  <bfulgham@apple.com>
+
+        Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
+        https://bugs.webkit.org/show_bug.cgi?id=185451
+        <rdar://problem/39620348>
+
+        Reviewed by Zalan Bujtas.
+
+        Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
+        PlatformScreenMac implementation to less expensive Debug ASSERTS.
+
+        No change in behavior.
+
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::screenHasInvertedColors):
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenRectForDisplay):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        (WebCore::screenColorSpace):
+        (WebCore::screenSupportsExtendedColor):
+
 2018-05-08  Daniel Bates  <dabates@apple.com>
 
         Resign Strong Password appearance when text field value changes
 2018-05-08  Daniel Bates  <dabates@apple.com>
 
         Resign Strong Password appearance when text field value changes
index 815aa65..6298122 100644 (file)
@@ -181,7 +181,7 @@ bool screenHasInvertedColors()
         return screenProperties(primaryScreenDisplayID()).screenHasInvertedColors;
 
     // This is a system-wide accessibility setting, same on all screens.
         return screenProperties(primaryScreenDisplayID()).screenHasInvertedColors;
 
     // This is a system-wide accessibility setting, same on all screens.
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return CGDisplayUsesInvertedPolarity();
 }
 
     return CGDisplayUsesInvertedPolarity();
 }
 
@@ -193,7 +193,7 @@ int screenDepth(Widget* widget)
         return screenDepth;
     }
 
         return screenDepth;
     }
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return NSBitsPerPixelFromDepth(screen(widget).depth);
 }
 
     return NSBitsPerPixelFromDepth(screen(widget).depth);
 }
 
@@ -205,7 +205,7 @@ int screenDepthPerComponent(Widget* widget)
         return depthPerComponent;
     }
 
         return depthPerComponent;
     }
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return NSBitsPerSampleFromDepth(screen(widget).depth);
 }
 
     return NSBitsPerSampleFromDepth(screen(widget).depth);
 }
 
@@ -217,7 +217,7 @@ FloatRect screenRectForDisplay(PlatformDisplayID displayID)
         return screenRect;
     }
 
         return screenRect;
     }
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return screen(displayID).frame;
 }
 
     return screen(displayID).frame;
 }
 
@@ -226,7 +226,7 @@ FloatRect screenRect(Widget* widget)
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).screenRect;
 
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).screenRect;
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return toUserSpace([screen(widget) frame], window(widget));
 }
 
     return toUserSpace([screen(widget) frame], window(widget));
 }
 
@@ -235,7 +235,7 @@ FloatRect screenAvailableRect(Widget* widget)
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).screenAvailableRect;
 
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).screenAvailableRect;
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return toUserSpace([screen(widget) visibleFrame], window(widget));
 }
 
     return toUserSpace([screen(widget) visibleFrame], window(widget));
 }
 
@@ -260,7 +260,7 @@ CGColorSpaceRef screenColorSpace(Widget* widget)
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).colorSpace.get();
 
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).colorSpace.get();
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return screen(widget).colorSpace.CGColorSpace;
 }
 
     return screen(widget).colorSpace.CGColorSpace;
 }
 
@@ -269,7 +269,7 @@ bool screenSupportsExtendedColor(Widget* widget)
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).screenSupportsExtendedColor;
 
     if (!screenProperties().isEmpty())
         return getScreenProperties(widget).screenSupportsExtendedColor;
 
-    RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
+    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     return [screen(widget) canRepresentDisplayGamut:NSDisplayGamutP3];
 }
 
     return [screen(widget) canRepresentDisplayGamut:NSDisplayGamutP3];
 }