Title: [231906] branches/safari-606.1.17-branch/Source/WebKit
Revision
231906
Author
kocsen_ch...@apple.com
Date
2018-05-17 09:34:15 -0700 (Thu, 17 May 2018)

Log Message

Cherry-pick r231770. rdar://problem/39915196

    [Wi-Fi Assertions] Allow clients to specify a context identifier
    https://bugs.webkit.org/show_bug.cgi?id=185620
    <rdar://problem/39915196>

    Reviewed by Brady Eidson.

    Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
    context identifier.

    * NetworkProcess/NetworkProcessCreationParameters.cpp:
    (WebKit::NetworkProcessCreationParameters::encode const):
    (WebKit::NetworkProcessCreationParameters::decode):
    * NetworkProcess/NetworkProcessCreationParameters.h:
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
    * UIProcess/API/APIProcessPoolConfiguration.cpp:
    (API::ProcessPoolConfiguration::copy):
    * UIProcess/API/APIProcessPoolConfiguration.h:
    * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
    * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
    (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
    (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

Modified Paths

Diff

Modified: branches/safari-606.1.17-branch/Source/WebKit/ChangeLog (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-17 16:34:15 UTC (rev 231906)
@@ -1,5 +1,64 @@
 2018-05-17  Kocsen Chung  <kocsen_ch...@apple.com>
 
+        Cherry-pick r231770. rdar://problem/39915196
+
+    [Wi-Fi Assertions] Allow clients to specify a context identifier
+    https://bugs.webkit.org/show_bug.cgi?id=185620
+    <rdar://problem/39915196>
+    
+    Reviewed by Brady Eidson.
+    
+    Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
+    context identifier.
+    
+    * NetworkProcess/NetworkProcessCreationParameters.cpp:
+    (WebKit::NetworkProcessCreationParameters::encode const):
+    (WebKit::NetworkProcessCreationParameters::decode):
+    * NetworkProcess/NetworkProcessCreationParameters.h:
+    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+    (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+    * UIProcess/API/APIProcessPoolConfiguration.cpp:
+    (API::ProcessPoolConfiguration::copy):
+    * UIProcess/API/APIProcessPoolConfiguration.h:
+    * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
+    * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
+    (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
+    (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-14  Andy Estes  <aes...@apple.com>
+
+            [Wi-Fi Assertions] Allow clients to specify a context identifier
+            https://bugs.webkit.org/show_bug.cgi?id=185620
+            <rdar://problem/39915196>
+
+            Reviewed by Brady Eidson.
+
+            Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
+            context identifier.
+
+            * NetworkProcess/NetworkProcessCreationParameters.cpp:
+            (WebKit::NetworkProcessCreationParameters::encode const):
+            (WebKit::NetworkProcessCreationParameters::decode):
+            * NetworkProcess/NetworkProcessCreationParameters.h:
+            * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+            (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+            * UIProcess/API/APIProcessPoolConfiguration.cpp:
+            (API::ProcessPoolConfiguration::copy):
+            * UIProcess/API/APIProcessPoolConfiguration.h:
+            * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
+            * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
+            (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
+            (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
+            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+            (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+
+2018-05-17  Kocsen Chung  <kocsen_ch...@apple.com>
+
         Cherry-pick r231893. rdar://problem/40247351
 
     Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes

Modified: branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp	2018-05-17 16:34:15 UTC (rev 231906)
@@ -117,6 +117,10 @@
     encoder << urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
 
     encoder << trackNetworkActivity;
+    
+#if ENABLE(WIFI_ASSERTIONS)
+    encoder << wirelessContextIdentifier;
+#endif
 }
 
 bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProcessCreationParameters& result)
@@ -280,6 +284,11 @@
     if (!decoder.decode(result.trackNetworkActivity))
         return false;
 
+#if ENABLE(WIFI_ASSERTIONS)
+    if (!decoder.decode(result.wirelessContextIdentifier))
+        return false;
+#endif
+
     return true;
 }
 

Modified: branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h	2018-05-17 16:34:15 UTC (rev 231906)
@@ -134,6 +134,10 @@
     Vector<String> urlSchemesRegisteredAsCORSEnabled;
 
     bool trackNetworkActivity { false };
+    
+#if ENABLE(WIFI_ASSERTIONS)
+    unsigned wirelessContextIdentifier { 0 };
+#endif
 };
 
 } // namespace WebKit

Modified: branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm	2018-05-17 16:34:15 UTC (rev 231906)
@@ -44,6 +44,10 @@
 #import <wtf/CallbackAggregator.h>
 #import <wtf/ProcessPrivilege.h>
 
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/NetworkProcessCocoaAdditions.mm>
+#endif
+
 namespace WebKit {
 
 static void initializeNetworkSettings()
@@ -111,6 +115,10 @@
         SandboxExtension::consumePermanently(parameters.cacheStorageDirectoryExtensionHandle);
     }
 
+#if ENABLE(WIFI_ASSERTIONS)
+    initializeWiFiAssertions(parameters);
+#endif
+
     if (!m_diskCacheDirectory.isNull()) {
         SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
         if (parameters.shouldEnableNetworkCache) {

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp	2018-05-17 16:34:15 UTC (rev 231906)
@@ -131,6 +131,9 @@
     copy->m_alwaysKeepAndReuseSwappedProcesses = this->m_alwaysKeepAndReuseSwappedProcesses;
     copy->m_processSwapsOnWindowOpenWithOpener = this->m_processSwapsOnWindowOpenWithOpener;
     copy->m_trackNetworkActivity = this->m_trackNetworkActivity;
+#if ENABLE(WIFI_ASSERTIONS)
+    copy->m_wirelessContextIdentifier = this->m_wirelessContextIdentifier;
+#endif
 
     return copy;
 }

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h	2018-05-17 16:34:15 UTC (rev 231906)
@@ -147,6 +147,11 @@
     bool trackNetworkActivity() const { return m_trackNetworkActivity; }
     void setTrackNetworkActivity(bool track) { m_trackNetworkActivity = track; }
 
+#if ENABLE(WIFI_ASSERTIONS)
+    unsigned wirelessContextIdentifier() const { return m_wirelessContextIdentifier; }
+    void setWirelessContextIdentifier(unsigned wirelessContextIdentifier) { m_wirelessContextIdentifier = wirelessContextIdentifier; }
+#endif
+
 private:
     bool m_shouldHaveLegacyDataStore { false };
 
@@ -186,6 +191,10 @@
 #if PLATFORM(IOS)
     WTF::String m_ctDataConnectionServiceType;
 #endif
+
+#if ENABLE(WIFI_ASSERTIONS)
+    unsigned m_wirelessContextIdentifier { 0 };
+#endif
 };
 
 } // namespace API

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h	2018-05-17 16:34:15 UTC (rev 231906)
@@ -40,6 +40,10 @@
 
 @property (nonatomic, copy) NSArray<NSURL *> *additionalReadAccessAllowedURLs WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 
+#if TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR
+@property (nonatomic) NSUInteger wirelessContextIdentifier;
+#endif
+
 // Network Process properties
 // FIXME: These should be be per-session/data store when we support multiple non-persistent sessions/data stores.
 

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm	2018-05-17 16:34:15 UTC (rev 231906)
@@ -129,6 +129,18 @@
     _processPoolConfiguration->setAdditionalReadAccessAllowedPaths(WTFMove(paths));
 }
 
+#if ENABLE(WIFI_ASSERTIONS)
+- (NSUInteger)wirelessContextIdentifier
+{
+    return _processPoolConfiguration->wirelessContextIdentifier();
+}
+
+- (void)setWirelessContextIdentifier:(NSUInteger)identifier
+{
+    _processPoolConfiguration->setWirelessContextIdentifier(identifier);
+}
+#endif
+
 - (NSArray *)cachePartitionedURLSchemes
 {
     auto schemes = _processPoolConfiguration->cachePartitionedURLSchemes();

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (231905 => 231906)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-05-17 16:18:24 UTC (rev 231905)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-05-17 16:34:15 UTC (rev 231906)
@@ -328,6 +328,10 @@
     if (parameters.recordReplayCacheLocation.isEmpty())
         parameters.recordReplayCacheLocation = parameters.diskCacheDirectory;
 #endif
+
+#if ENABLE(WIFI_ASSERTIONS)
+    parameters.wirelessContextIdentifier = m_configuration->wirelessContextIdentifier();
+#endif
 }
 
 void WebProcessPool::platformInvalidateContext()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to