Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2018 23:28:41 +0000 (23:28 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2018 23:28:41 +0000 (23:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186056

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests, no change in behavior.

* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenProperties):
(WebCore::getScreenProperties):
(WebCore::setScreenProperties):

Source/WebKit:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:

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

Source/WebCore/ChangeLog
Source/WebCore/platform/PlatformScreen.h
Source/WebCore/platform/mac/PlatformScreenMac.mm
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebProcessCreationParameters.cpp
Source/WebKit/Shared/WebProcessCreationParameters.h

index 06db959..75add1d 100644 (file)
@@ -1,3 +1,18 @@
+2018-05-29  Per Arne Vollan  <pvollan@apple.com>
+
+        Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
+        https://bugs.webkit.org/show_bug.cgi?id=186056
+
+        Reviewed by Brent Fulgham.
+
+        No new tests, no change in behavior.
+
+        * platform/PlatformScreen.h:
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::screenProperties):
+        (WebCore::getScreenProperties):
+        (WebCore::setScreenProperties):
+
 2018-05-29  Ryosuke Niwa  <rniwa@webkit.org>
 
         iOS WK1: Occasional crash in sanitizedMarkupForFragmentInDocument
index 061ff65..4d1d7fe 100644 (file)
@@ -93,8 +93,10 @@ WEBCORE_EXPORT NSRect toDeviceSpace(const FloatRect&, NSWindow *source);
 
 NSPoint flipScreenPoint(const NSPoint&, NSScreen *);
 
-WEBCORE_EXPORT std::pair<PlatformDisplayID, HashMap<PlatformDisplayID, ScreenProperties>> getScreenProperties();
-WEBCORE_EXPORT void setScreenProperties(PlatformDisplayID primaryScreenID, const HashMap<PlatformDisplayID, ScreenProperties>&);
+typedef HashMap<PlatformDisplayID, ScreenProperties> ScreenPropertiesMap;
+
+WEBCORE_EXPORT std::pair<PlatformDisplayID, ScreenPropertiesMap> getScreenProperties();
+WEBCORE_EXPORT void setScreenProperties(PlatformDisplayID primaryScreenID, const ScreenPropertiesMap&);
 ScreenProperties screenProperties(PlatformDisplayID);
 
 #endif
index c31add9..04ec8c7 100644 (file)
@@ -96,9 +96,9 @@ static NSScreen *screen(Widget* widget)
     return screen(displayID(widget));
 }
 
-static HashMap<PlatformDisplayID, ScreenProperties>& screenProperties()
+static ScreenPropertiesMap& screenProperties()
 {
-    static NeverDestroyed<HashMap<PlatformDisplayID, ScreenProperties>> screenProperties;
+    static NeverDestroyed<ScreenPropertiesMap> screenProperties;
     return screenProperties;
 }
 
@@ -108,11 +108,11 @@ static PlatformDisplayID& primaryScreenDisplayID()
     return primaryScreenDisplayID;
 }
 
-std::pair<PlatformDisplayID, HashMap<PlatformDisplayID, ScreenProperties>> getScreenProperties()
+std::pair<PlatformDisplayID, ScreenPropertiesMap> getScreenProperties()
 {
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
 
-    HashMap<PlatformDisplayID, ScreenProperties> screenProperties;
+    ScreenPropertiesMap screenProperties;
     std::optional<PlatformDisplayID> firstScreen;
 
     for (NSScreen *screen in [NSScreen screens]) {
@@ -138,7 +138,7 @@ std::pair<PlatformDisplayID, HashMap<PlatformDisplayID, ScreenProperties>> getSc
     return { WTFMove(*firstScreen), WTFMove(screenProperties) };
 }
 
-void setScreenProperties(PlatformDisplayID primaryScreenID, const HashMap<PlatformDisplayID, ScreenProperties>& properties)
+void setScreenProperties(PlatformDisplayID primaryScreenID, const ScreenPropertiesMap& properties)
 {
     primaryScreenDisplayID() = primaryScreenID;
     screenProperties() = properties;
index 721f472..92ab8ca 100644 (file)
@@ -1,3 +1,14 @@
+2018-05-29  Per Arne Vollan  <pvollan@apple.com>
+
+        Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
+        https://bugs.webkit.org/show_bug.cgi?id=186056
+
+        Reviewed by Brent Fulgham.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+
 2018-05-25  Jiewen Tan  <jiewen_tan@apple.com>
 
         Tighten sandbox profiles for Networking Processes to restrict accesses to macOS/iOS Keychains
index 0052cbe..cadf220 100644 (file)
@@ -410,7 +410,7 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat
     if (!decoder.decode(parameters.primaryDisplayID))
         return false;
 
-    std::optional<HashMap<WebCore::PlatformDisplayID, WebCore::ScreenProperties>> screenPropertiesMap;
+    std::optional<WebCore::ScreenPropertiesMap> screenPropertiesMap;
     decoder >> screenPropertiesMap;
     if (!screenPropertiesMap)
         return false;
index 1103b5f..5e825b7 100644 (file)
@@ -196,7 +196,7 @@ struct WebProcessCreationParameters {
 
 #if PLATFORM(MAC)
     WebCore::PlatformDisplayID primaryDisplayID { 0 };
-    HashMap<WebCore::PlatformDisplayID, WebCore::ScreenProperties> screenPropertiesMap;
+    WebCore::ScreenPropertiesMap screenPropertiesMap;
 #endif
 };