Title: [232260] trunk/Source/WebKit
Revision
232260
Author
pvol...@apple.com
Date
2018-05-29 09:50:12 -0700 (Tue, 29 May 2018)

Log Message

Follow-up fixes after r228907.
https://bugs.webkit.org/show_bug.cgi?id=183338

Reviewed by Brent Fulgham.

Add screen properties to the WebProcess creation parameters, instead of sending
them in a message to the WebProcess just after starting it up.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (232259 => 232260)


--- trunk/Source/WebKit/ChangeLog	2018-05-29 16:19:09 UTC (rev 232259)
+++ trunk/Source/WebKit/ChangeLog	2018-05-29 16:50:12 UTC (rev 232260)
@@ -1,3 +1,24 @@
+2018-05-29  Per Arne Vollan  <pvol...@apple.com>
+
+        Follow-up fixes after r228907.
+        https://bugs.webkit.org/show_bug.cgi?id=183338
+
+        Reviewed by Brent Fulgham.
+
+        Add screen properties to the WebProcess creation parameters, instead of sending
+        them in a message to the WebProcess just after starting it up.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2018-05-29  Sihui Liu  <sihui_...@apple.com>
 
         Unable to remove IndexedDB Databases with Cocoa API removeDataOfTypes

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (232259 => 232260)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2018-05-29 16:19:09 UTC (rev 232259)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2018-05-29 16:50:12 UTC (rev 232260)
@@ -154,6 +154,11 @@
 #if PLATFORM(COCOA)
     encoder << mediaMIMETypes;
 #endif
+
+#if PLATFORM(MAC)
+    encoder << primaryDisplayID;
+    encoder << screenPropertiesMap;
+#endif
 }
 
 bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreationParameters& parameters)
@@ -401,6 +406,17 @@
         return false;
 #endif
 
+#if PLATFORM(MAC)
+    if (!decoder.decode(parameters.primaryDisplayID))
+        return false;
+
+    std::optional<HashMap<WebCore::PlatformDisplayID, WebCore::ScreenProperties>> screenPropertiesMap;
+    decoder >> screenPropertiesMap;
+    if (!screenPropertiesMap)
+        return false;
+    parameters.screenPropertiesMap = WTFMove(*screenPropertiesMap);
+#endif
+
     return true;
 }
 

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (232259 => 232260)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2018-05-29 16:19:09 UTC (rev 232259)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2018-05-29 16:50:12 UTC (rev 232260)
@@ -41,6 +41,11 @@
 #include <wtf/MachSendRight.h>
 #endif
 
+#if PLATFORM(MAC)
+#include <WebCore/PlatformScreen.h>
+#include <WebCore/ScreenProperties.h>
+#endif
+
 #if USE(SOUP)
 #include "HTTPCookieAcceptPolicy.h"
 #include <WebCore/SoupNetworkProxySettings.h>
@@ -188,6 +193,11 @@
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED
     bool shouldLogUserInteraction { false };
 #endif
+
+#if PLATFORM(MAC)
+    WebCore::PlatformDisplayID primaryDisplayID { 0 };
+    HashMap<WebCore::PlatformDisplayID, WebCore::ScreenProperties> screenPropertiesMap;
+#endif
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (232259 => 232260)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-05-29 16:19:09 UTC (rev 232259)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-05-29 16:50:12 UTC (rev 232260)
@@ -280,6 +280,12 @@
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED
     parameters.shouldLogUserInteraction = [defaults boolForKey:WebKitLogCookieInformationDefaultsKey];
 #endif
+    
+#if PLATFORM(MAC)
+    auto screenProperties = WebCore::getScreenProperties();
+    parameters.primaryDisplayID = screenProperties.first;
+    parameters.screenPropertiesMap = WTFMove(screenProperties.second);
+#endif
 }
 
 void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (232259 => 232260)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-05-29 16:19:09 UTC (rev 232259)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-05-29 16:50:12 UTC (rev 232260)
@@ -991,9 +991,6 @@
 
 #if PLATFORM(MAC)
     registerDisplayConfigurationCallback();
-
-    auto screenProperties = WebCore::getScreenProperties();
-    process.send(Messages::WebProcess::SetScreenProperties(screenProperties.first, screenProperties.second), 0);
 #endif
 }
 

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (232259 => 232260)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-05-29 16:19:09 UTC (rev 232259)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-05-29 16:50:12 UTC (rev 232260)
@@ -191,6 +191,10 @@
             parentProcessConnection()->send(Messages::WebProcessProxy::CacheMediaMIMETypes(types), 0);
         });
     }
+
+#if PLATFORM(MAC)
+    WebCore::setScreenProperties(parameters.primaryDisplayID, parameters.screenPropertiesMap);
+#endif
 }
 
 void WebProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to