Title: [232283] trunk/Source/WebKit
Revision
232283
Author
aes...@apple.com
Date
2018-05-29 17:47:00 -0700 (Tue, 29 May 2018)

Log Message

[Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
https://bugs.webkit.org/show_bug.cgi?id=185983
<rdar://problem/40205486>

Reviewed by Tim Horton.

* Configurations/Network-iOS.entitlements:

Added a needed entitlement.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/WiFiAssertionHolder.h:
(WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):

Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.

* NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
(holdWiFiAssertion):
(releaseWiFiAssertion):
(WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
(WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):

Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
WiFiAssertionHolder as an argument.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

Added a needed sandbox extension.

* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (232282 => 232283)


--- trunk/Source/WebKit/ChangeLog	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/ChangeLog	2018-05-30 00:47:00 UTC (rev 232283)
@@ -1,3 +1,36 @@
+2018-05-29  Andy Estes  <aes...@apple.com>
+
+        [Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
+        https://bugs.webkit.org/show_bug.cgi?id=185983
+        <rdar://problem/40205486>
+
+        Reviewed by Tim Horton.
+
+        * Configurations/Network-iOS.entitlements:
+
+        Added a needed entitlement.
+
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
+        * NetworkProcess/cocoa/WiFiAssertionHolder.h:
+        (WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):
+
+        Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.
+
+        * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
+        (holdWiFiAssertion):
+        (releaseWiFiAssertion):
+        (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
+        (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
+
+        Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
+        WiFiAssertionHolder as an argument.
+
+        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
+
+        Added a needed sandbox extension.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
 2018-05-29  Youenn Fablet  <you...@apple.com>
 
         Add a consistency check between URL and CFURL

Modified: trunk/Source/WebKit/Configurations/Network-iOS.entitlements (232282 => 232283)


--- trunk/Source/WebKit/Configurations/Network-iOS.entitlements	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/Configurations/Network-iOS.entitlements	2018-05-30 00:47:00 UTC (rev 232283)
@@ -2,6 +2,8 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>com.apple.private.ids.link-preferences</key>
+	<true/>
 	<key>com.apple.wifi.manager-access</key>
 	<true/>
 	<key>com.apple.private.accounts.bundleidspoofing</key>

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h (232282 => 232283)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h	2018-05-30 00:47:00 UTC (rev 232283)
@@ -74,10 +74,10 @@
     uint64_t pageID() const { return m_pageID; };
 
 #if ENABLE(WIFI_ASSERTIONS)
-    void acquireWiFiAssertion()
+    void maybeHoldWiFiAssertion(bool shouldHoldWiFiAssertion)
     {
         ASSERT(!m_wiFiAssertionHolder);
-        m_wiFiAssertionHolder.emplace();
+        m_wiFiAssertionHolder.emplace(shouldHoldWiFiAssertion);
     }
 #endif
 

Deleted: trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp (232282 => 232283)


--- trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp	2018-05-30 00:47:00 UTC (rev 232283)
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WiFiAssertionHolder.h"
-
-#if HAVE(MOBILE_WIFI)
-
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WiFiAssertionHolderAdditions.cpp>
-#else
-static void holdWiFiAssertion()
-{
-}
-
-static void releaseWiFiAssertion()
-{
-}
-#endif
-
-namespace WebKit {
-
-WiFiAssertionHolder::WiFiAssertionHolder()
-{
-    holdWiFiAssertion();
-}
-
-WiFiAssertionHolder::~WiFiAssertionHolder()
-{
-    releaseWiFiAssertion();
-}
-
-} // namespace WebKit
-
-#endif // HAVE(MOBILE_WIFI)

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.h (232282 => 232283)


--- trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.h	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.h	2018-05-30 00:47:00 UTC (rev 232283)
@@ -34,8 +34,13 @@
 class WiFiAssertionHolder {
     WTF_MAKE_NONCOPYABLE(WiFiAssertionHolder);
 public:
-    WiFiAssertionHolder();
+    explicit WiFiAssertionHolder(bool shouldHoldWiFiAssertion);
     ~WiFiAssertionHolder();
+
+    bool shouldHoldWiFiAssertion() const { return m_shouldHoldWiFiAssertion; }
+
+private:
+    bool m_shouldHoldWiFiAssertion;
 };
 
 } // namespace WebKit

Copied: trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.mm (from rev 232282, trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp) (0 => 232283)


--- trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.mm	                        (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.mm	2018-05-30 00:47:00 UTC (rev 232283)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WiFiAssertionHolder.h"
+
+#if HAVE(MOBILE_WIFI)
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WiFiAssertionHolderAdditions.mm>
+#else
+static void holdWiFiAssertion(const WiFiAssertionHolder&)
+{
+}
+
+static void releaseWiFiAssertion(const WiFiAssertionHolder&)
+{
+}
+#endif
+
+namespace WebKit {
+
+WiFiAssertionHolder::WiFiAssertionHolder(bool shouldHoldWiFiAssertion)
+    : m_shouldHoldWiFiAssertion { shouldHoldWiFiAssertion }
+{
+    holdWiFiAssertion(*this);
+}
+
+WiFiAssertionHolder::~WiFiAssertionHolder()
+{
+    releaseWiFiAssertion(*this);
+}
+
+} // namespace WebKit
+
+#endif // HAVE(MOBILE_WIFI)

Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb (232282 => 232283)


--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb	2018-05-30 00:47:00 UTC (rev 232283)
@@ -95,4 +95,5 @@
     (global-name "com.apple.lsd.mapdb")
     (global-name "com.apple.analyticsd")
     (global-name "com.apple.WirelessCoexManager")
-    (global-name "com.apple.wifi.manager"))
+    (global-name "com.apple.wifi.manager")
+    (global-name "com.apple.identityservicesd.embedded.auth"))

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (232282 => 232283)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-05-30 00:40:28 UTC (rev 232282)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-05-30 00:47:00 UTC (rev 232283)
@@ -1582,7 +1582,7 @@
 		A1C512C9190656E500448914 /* WebPreviewLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C512C7190656E500448914 /* WebPreviewLoaderClient.h */; };
 		A1D420471DB5578500BB6B0D /* WKContextMenuListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1EA02351DABFF7E0096021F /* WKContextMenuListener.cpp */; };
 		A1DAFDDF207E9B16005E8A52 /* WiFiAssertionHolder.h in Headers */ = {isa = PBXBuildFile; fileRef = A1DAFDDD207E9B16005E8A52 /* WiFiAssertionHolder.h */; };
-		A1DAFDE0207E9B16005E8A52 /* WiFiAssertionHolder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DAFDDE207E9B16005E8A52 /* WiFiAssertionHolder.cpp */; };
+		A1DAFDE0207E9B16005E8A52 /* WiFiAssertionHolder.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1DAFDDE207E9B16005E8A52 /* WiFiAssertionHolder.mm */; };
 		A1DF631218E0B7C8003A3E2A /* DownloadClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */; };
 		A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1DF631118E0B7C8003A3E2A /* DownloadClient.h */; };
 		A1E688701F6E2BAB007006A6 /* QuarantineSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1E6886F1F6E2BAB007006A6 /* QuarantineSPI.h */; };
@@ -4073,7 +4073,7 @@
 		A1C512C6190656E500448914 /* WebPreviewLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPreviewLoaderClient.cpp; path = ios/WebPreviewLoaderClient.cpp; sourceTree = "<group>"; };
 		A1C512C7190656E500448914 /* WebPreviewLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPreviewLoaderClient.h; path = ios/WebPreviewLoaderClient.h; sourceTree = "<group>"; };
 		A1DAFDDD207E9B16005E8A52 /* WiFiAssertionHolder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WiFiAssertionHolder.h; path = NetworkProcess/cocoa/WiFiAssertionHolder.h; sourceTree = "<group>"; };
-		A1DAFDDE207E9B16005E8A52 /* WiFiAssertionHolder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = WiFiAssertionHolder.cpp; path = NetworkProcess/cocoa/WiFiAssertionHolder.cpp; sourceTree = "<group>"; };
+		A1DAFDDE207E9B16005E8A52 /* WiFiAssertionHolder.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WiFiAssertionHolder.mm; path = NetworkProcess/cocoa/WiFiAssertionHolder.mm; sourceTree = "<group>"; };
 		A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadClient.mm; sourceTree = "<group>"; };
 		A1DF631118E0B7C8003A3E2A /* DownloadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadClient.h; sourceTree = "<group>"; };
 		A1E6886F1F6E2BAB007006A6 /* QuarantineSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QuarantineSPI.h; sourceTree = "<group>"; };
@@ -6944,8 +6944,8 @@
 				7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */,
 				532159501DBAE6D70054AA3C /* NetworkSessionCocoa.h */,
 				5C20CB9B1BB0DCD200895BB1 /* NetworkSessionCocoa.mm */,
-				A1DAFDDE207E9B16005E8A52 /* WiFiAssertionHolder.cpp */,
 				A1DAFDDD207E9B16005E8A52 /* WiFiAssertionHolder.h */,
+				A1DAFDDE207E9B16005E8A52 /* WiFiAssertionHolder.mm */,
 			);
 			name = cocoa;
 			sourceTree = "<group>";
@@ -11213,7 +11213,7 @@
 				83EE575B1DB7D61100C74C50 /* WebValidationMessageClient.cpp in Sources */,
 				2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */,
 				C0337DD1127A2980008FF4F4 /* WebWheelEvent.cpp in Sources */,
-				A1DAFDE0207E9B16005E8A52 /* WiFiAssertionHolder.cpp in Sources */,
+				A1DAFDE0207E9B16005E8A52 /* WiFiAssertionHolder.mm in Sources */,
 				868160D0187645570021E79D /* WindowServerConnection.mm in Sources */,
 				29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm in Sources */,
 				29232DF818B2A9AE00D0596F /* WKAccessibilityWebPageObjectIOS.mm in Sources */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to