[WK2][Cocoa] Allow network process to bind addresses without webrtc extension
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2017 03:25:12 +0000 (03:25 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2017 03:25:12 +0000 (03:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173032
<rdar://problem/32597426>

Reviewed by Youenn Fablet.

Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've
decided that all WebKit clients should be able to use the WebRTC protocol.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization.
(WebKit::NetworkProcessCreationParameters::decode): Ditto.
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension,
so don't attempt to consume it.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc'
extension. Make rules conditional on building with WEB_RTC feature enabled.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc'
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension
handle.

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

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.cpp
Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.h
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit2/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in
Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm

index 07e453b..8e5fd18 100644 (file)
@@ -1,3 +1,28 @@
+2017-06-06  Brent Fulgham  <bfulgham@apple.com>
+
+        [WK2][Cocoa] Allow network process to bind addresses without webrtc extension
+        https://bugs.webkit.org/show_bug.cgi?id=173032
+        <rdar://problem/32597426>
+
+        Reviewed by Youenn Fablet.
+
+        Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've
+        decided that all WebKit clients should be able to use the WebRTC protocol.
+
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization.
+        (WebKit::NetworkProcessCreationParameters::decode): Ditto.
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension,
+        so don't attempt to consume it.
+        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc'
+        extension. Make rules conditional on building with WEB_RTC feature enabled.
+        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc'
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension
+        handle.
+
 2017-06-06  Tim Horton  <timothy_horton@apple.com>
 
         Crash trying to drag the entire text of a long book out of Mail compose view
index 56fbd8d..4f0beb2 100644 (file)
@@ -100,9 +100,6 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << recordReplayMode;
     encoder << recordReplayCacheLocation;
 #endif
-#if ENABLE(WEB_RTC)
-    encoder << webRTCNetworkingHandle;
-#endif
 }
 
 bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProcessCreationParameters& result)
@@ -209,11 +206,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc
         return false;
 #endif
 
-#if ENABLE(WEB_RTC)
-    if (!decoder.decode(result.webRTCNetworkingHandle))
-        return false;
-#endif
-
     return true;
 }
 
index 20ac587..736d07a 100644 (file)
@@ -114,9 +114,6 @@ struct NetworkProcessCreationParameters {
     String recordReplayMode;
     String recordReplayCacheLocation;
 #endif
-#if ENABLE(WEB_RTC)
-    SandboxExtension::Handle webRTCNetworkingHandle;
-#endif
 };
 
 } // namespace WebKit
index ace4789..15e271d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -72,9 +72,6 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC
     SandboxExtension::consumePermanently(parameters.containerCachesDirectoryExtensionHandle);
     SandboxExtension::consumePermanently(parameters.parentBundleDirectoryExtensionHandle);
 #endif
-#if ENABLE(WEB_RTC)
-    SandboxExtension::consumePermanently(parameters.webRTCNetworkingHandle);
-#endif
     m_diskCacheDirectory = parameters.diskCacheDirectory;
 
 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
index fa463a8..1019ca5 100644 (file)
         (set! allow orig-allow))))
 
 ;; FIXME should be removed when <rdar://problem/30498072> is fixed.
-(with-filter (extension "com.apple.webkit.webrtc")
-    (allow network*
-        (local udp)
-        (remote udp)
-        (local tcp)
-        (remote tcp)))
+(allow network*
+    (local udp)
+    (remote udp)
+    (local tcp)
+    (remote tcp))
+
index 3bb4bbc..8186eb2 100644 (file)
        (vnode-type SYMLINK))
 
 ;; FIXME should be removed when <rdar://problem/30498072> is fixed.
-(with-filter (extension "com.apple.webkit.webrtc")
-    (allow network*
-        (local udp)
-        (remote udp)
-        (local tcp)
-        (remote tcp)))
+(allow network*
+    (local udp)
+    (remote udp)
+    (local tcp)
+    (remote tcp))
 
 ;; Various services required by system frameworks
 (allow mach-lookup
index 8a77a33..05bf8d0 100644 (file)
@@ -303,14 +303,6 @@ void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationPara
     if (parameters.recordReplayCacheLocation.isEmpty())
         parameters.recordReplayCacheLocation = parameters.diskCacheDirectory;
 #endif
-#if ENABLE(WEB_RTC)
-    bool webRTCEnabled = m_defaultPageGroup->preferences().peerConnectionEnabled();
-    if ([defaults objectForKey:@"ExperimentalPeerConnectionEnabled"])
-        webRTCEnabled = [defaults boolForKey:@"ExperimentalPeerConnectionEnabled"];
-
-    if (webRTCEnabled)
-        SandboxExtension::createHandleForGenericExtension("com.apple.webkit.webrtc", parameters.webRTCNetworkingHandle);
-#endif
 }
 
 void WebProcessPool::platformInvalidateContext()