Add WebProcessPool option for process swapping on navigation.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Feb 2018 02:12:04 +0000 (02:12 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Feb 2018 02:12:04 +0000 (02:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182945

Reviewed by Alex Christensen.

Just the most basic groundwork for testing a new WK2 feature.

* UIProcess/API/APIProcessPoolConfiguration.h:

* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationProcessSwapsOnNavigation):
(WKContextConfigurationSetProcessSwapsOnNavigation):
* UIProcess/API/C/WKContextConfigurationRef.h:

* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
(-[_WKProcessPoolConfiguration processSwapsOnNavigation]):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.cpp
Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm

index d57b5b0..3dbfef7 100644 (file)
@@ -1,3 +1,24 @@
+2018-02-19  Brady Eidson  <beidson@apple.com>
+
+        Add WebProcessPool option for process swapping on navigation.
+        https://bugs.webkit.org/show_bug.cgi?id=182945
+
+        Reviewed by Alex Christensen.
+
+        Just the most basic groundwork for testing a new WK2 feature.
+
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+
+        * UIProcess/API/C/WKContextConfigurationRef.cpp:
+        (WKContextConfigurationProcessSwapsOnNavigation):
+        (WKContextConfigurationSetProcessSwapsOnNavigation):
+        * UIProcess/API/C/WKContextConfigurationRef.h:
+
+        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
+        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
+        (-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
+        (-[_WKProcessPoolConfiguration processSwapsOnNavigation]):
+
 2018-02-19  Daniel Bates  <dabates@apple.com>
 
         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
index 196c2dd..831146b 100644 (file)
@@ -135,6 +135,9 @@ public:
     ProcessID presentingApplicationPID() const { return m_presentingApplicationPID; }
     void setPresentingApplicationPID(ProcessID pid) { m_presentingApplicationPID = pid; }
 
+    bool processSwapsOnNavigation() const { return m_processSwapsOnNavigation; }
+    void setProcessSwapsOnNavigation(bool swaps) { m_processSwapsOnNavigation = swaps; }
+
 private:
     bool m_shouldHaveLegacyDataStore { false };
 
@@ -166,6 +169,8 @@ private:
     bool m_shouldTakeUIBackgroundAssertion { true };
     bool m_shouldCaptureAudioInUIProcess { false };
     ProcessID m_presentingApplicationPID { getCurrentProcessID() };
+    bool m_processSwapsOnNavigation { false };
+
 #if PLATFORM(IOS)
     WTF::String m_ctDataConnectionServiceType;
 #endif
index 8ac81dd..1554a94 100644 (file)
@@ -157,3 +157,13 @@ void WKContextConfigurationSetShouldCaptureAudioInUIProcess(WKContextConfigurati
 {
     toImpl(configuration)->setShouldCaptureAudioInUIProcess(should);
 }
+
+bool WKContextConfigurationProcessSwapsOnNavigation(WKContextConfigurationRef configuration)
+{
+    return toImpl(configuration)->processSwapsOnNavigation();
+}
+
+void WKContextConfigurationSetProcessSwapsOnNavigation(WKContextConfigurationRef configuration, bool swaps)
+{
+    toImpl(configuration)->setProcessSwapsOnNavigation(swaps);
+}
index d69bb85..d24eee5 100644 (file)
@@ -68,6 +68,9 @@ WK_EXPORT void WKContextConfigurationSetOverrideLanguages(WKContextConfiguration
 WK_EXPORT bool WKContextConfigurationShouldCaptureAudioInUIProcess(WKContextConfigurationRef configuration);
 WK_EXPORT void WKContextConfigurationSetShouldCaptureAudioInUIProcess(WKContextConfigurationRef configuration, bool allowed);
 
+WK_EXPORT bool WKContextConfigurationProcessSwapsOnNavigation(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetProcessSwapsOnNavigation(WKContextConfigurationRef configuration, bool swaps);
+
 #ifdef __cplusplus
 }
 #endif
index 5163291..0dcc25b 100644 (file)
@@ -57,6 +57,7 @@ WK_CLASS_AVAILABLE(macosx(10.10), ios(8.0))
 @property (nonatomic) BOOL shouldTakeUIBackgroundAssertion WK_API_AVAILABLE(ios(11.0));
 #endif
 @property (nonatomic) pid_t presentingApplicationPID WK_API_AVAILABLE(macosx(10.13), ios(11.0));
+@property (nonatomic) BOOL processSwapsOnNavigation WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @end
 
index 53a08b5..17fa6f1 100644 (file)
     return _processPoolConfiguration->presentingApplicationPID();
 }
 
+- (void)setProcessSwapsOnNavigation:(BOOL)swaps
+{
+    _processPoolConfiguration->setProcessSwapsOnNavigation(swaps);
+}
+
+- (BOOL)processSwapsOnNavigation
+{
+    return _processPoolConfiguration->processSwapsOnNavigation();
+}
+
 #if PLATFORM(IOS)
 - (NSString *)CTDataConnectionServiceType
 {