Diff
Modified: trunk/Source/WebCore/ChangeLog (240804 => 240805)
--- trunk/Source/WebCore/ChangeLog 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebCore/ChangeLog 2019-01-31 20:01:07 UTC (rev 240805)
@@ -1,3 +1,16 @@
+2019-01-31 Jiewen Tan <jiewen_...@apple.com>
+
+ Formalize WebKitAdditions mechanism of LoadOptimizer
+ https://bugs.webkit.org/show_bug.cgi?id=193886
+ <rdar://problem/47696809>
+
+ Reviewed by Brent Fulgham.
+
+ Covered by existing tests.
+
+ * platform/network/ResourceRequestBase.h:
+ Export isolatedCopy().
+
2019-01-31 Jer Noble <jer.no...@apple.com>
[Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.h (240804 => 240805)
--- trunk/Source/WebCore/platform/network/ResourceRequestBase.h 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.h 2019-01-31 20:01:07 UTC (rev 240805)
@@ -57,7 +57,7 @@
class ResourceRequestBase {
WTF_MAKE_FAST_ALLOCATED;
public:
- ResourceRequest isolatedCopy() const;
+ WEBCORE_EXPORT ResourceRequest isolatedCopy() const;
WEBCORE_EXPORT void setAsIsolatedCopy(const ResourceRequest&);
WEBCORE_EXPORT bool isNull() const;
Modified: trunk/Source/WebKit/ChangeLog (240804 => 240805)
--- trunk/Source/WebKit/ChangeLog 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/ChangeLog 2019-01-31 20:01:07 UTC (rev 240805)
@@ -1,3 +1,28 @@
+2019-01-31 Jiewen Tan <jiewen_...@apple.com>
+
+ Formalize WebKitAdditions mechanism of LoadOptimizer
+ https://bugs.webkit.org/show_bug.cgi?id=193886
+ <rdar://problem/47696809>
+
+ Reviewed by Brent Fulgham.
+
+ This patch does the following few things:
+ 1) formalizes WebKitAdditions mechanism of LoadOptimizer;
+ 2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr;
+ 3) lets AppLinks have higher precedence than LoadOptimizer.
+
+ * SourcesCocoa.txt:
+ * UIProcess/Cocoa/LoadOptimizer.h: Removed.
+ * UIProcess/Cocoa/LoadOptimizer.mm: Removed.
+ * UIProcess/Cocoa/NavigationState.mm:
+ (WebKit::tryOptimizingLoad):
+ (WebKit::tryInterceptNavigation):
+ * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+ (WebKit::WebsiteDataStore::WebsiteDataStore):
+ * UIProcess/WebsiteData/WebsiteDataStore.h:
+ (WebKit::WebsiteDataStore::loadOptimizer): Deleted.
+ * WebKit.xcodeproj/project.pbxproj:
+
2019-01-31 Chris Dumez <cdu...@apple.com>
Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
Modified: trunk/Source/WebKit/SourcesCocoa.txt (240804 => 240805)
--- trunk/Source/WebKit/SourcesCocoa.txt 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/SourcesCocoa.txt 2019-01-31 20:01:07 UTC (rev 240805)
@@ -324,7 +324,6 @@
UIProcess/Cocoa/GlobalFindInPageState.mm
UIProcess/Cocoa/IconLoadingDelegate.mm
UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm
-UIProcess/Cocoa/LoadOptimizer.mm
UIProcess/Cocoa/MediaCaptureUtilities.mm
UIProcess/Cocoa/NavigationState.mm
UIProcess/Cocoa/PageClientImplCocoa.mm
Deleted: trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h (240804 => 240805)
--- trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h 2019-01-31 20:01:07 UTC (rev 240805)
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2019 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.
- */
-
-#pragma once
-
-#if HAVE(LOAD_OPTIMIZER)
-#include <WebKitAdditions/LoadOptimizerAdditions.h>
-#endif
Deleted: trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm (240804 => 240805)
--- trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm 2019-01-31 20:01:07 UTC (rev 240805)
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2019 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 "LoadOptimizer.h"
-
-#if HAVE(LOAD_OPTIMIZER)
-#import <WebKitAdditions/LoadOptimizerAdditions.mm>
-#endif
Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (240804 => 240805)
--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm 2019-01-31 20:01:07 UTC (rev 240805)
@@ -37,7 +37,6 @@
#import "AuthenticationChallengeDisposition.h"
#import "AuthenticationDecisionListener.h"
#import "CompletionHandlerCallChecker.h"
-#import "LoadOptimizer.h"
#import "Logging.h"
#import "NavigationActionData.h"
#import "PageLoadState.h"
@@ -79,6 +78,10 @@
#import <pal/spi/cocoa/LaunchServicesSPI.h>
#endif
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/NavigationStateAdditions.mm>
+#endif
+
#if USE(QUICK_LOOK)
#import "QuickLookDocumentData.h"
#endif
@@ -465,29 +468,32 @@
}
#endif
+#if !USE(APPLE_INTERNAL_SDK)
+static void tryOptimizingLoad(const WebCore::ResourceRequest&, WebPageProxy&, Function<void(bool)>&& completionHandler)
+{
+ completionHandler(false);
+}
+#endif
+
static void tryInterceptNavigation(Ref<API::NavigationAction>&& navigationAction, WebPageProxy& page, WTF::Function<void(bool)>&& completionHandler)
{
#if HAVE(APP_LINKS)
if (navigationAction->shouldOpenAppLinks()) {
- auto* localCompletionHandler = new WTF::Function<void (bool)>(WTFMove(completionHandler));
- [LSAppLink openWithURL:navigationAction->request().url() completionHandler:[localCompletionHandler](BOOL success, NSError *) {
- dispatch_async(dispatch_get_main_queue(), [localCompletionHandler, success] {
- (*localCompletionHandler)(success);
- delete localCompletionHandler;
+ auto callback = makeBlockPtr([request = navigationAction->request().isolatedCopy(), weakPage = makeWeakPtr(page), completionHandler = WTFMove(completionHandler)] (BOOL success, NSError *) mutable {
+ RunLoop::main().dispatch([request = request.isolatedCopy(), weakPage, completionHandler = WTFMove(completionHandler), success]() mutable {
+ if (!success && weakPage) {
+ tryOptimizingLoad(request, *weakPage, WTFMove(completionHandler));
+ return;
+ }
+ completionHandler(success);
});
- }];
+ });
+ [LSAppLink openWithURL:navigationAction->request().url() completionHandler:callback.get()];
return;
}
#endif
-#if HAVE(LOAD_OPTIMIZER)
- if (LoadOptimizer::canOptimizeLoad(navigationAction->request().url())) {
- page.websiteDataStore().loadOptimizer().optimizeLoad(navigationAction->request(), page, WTFMove(completionHandler));
- return;
- }
-#endif
-
- completionHandler(false);
+ tryOptimizingLoad(navigationAction->request(), page, WTFMove(completionHandler));
}
void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageProxy& webPageProxy, Ref<API::NavigationAction>&& navigationAction, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userInfo)
Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (240804 => 240805)
--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp 2019-01-31 20:01:07 UTC (rev 240805)
@@ -56,10 +56,6 @@
#include <wtf/ProcessPrivilege.h>
#include <wtf/RunLoop.h>
-#if HAVE(LOAD_OPTIMIZER)
-#include "LoadOptimizer.h"
-#endif
-
#if ENABLE(NETSCAPE_PLUGIN_API)
#include "PluginProcessManager.h"
#endif
@@ -104,10 +100,10 @@
, m_authenticatorManager(makeUniqueRef<AuthenticatorManager>())
#endif
, m_client(makeUniqueRef<WebsiteDataStoreClient>())
+{
#if HAVE(LOAD_OPTIMIZER)
- , m_loadOptimizer(makeUniqueRef<LoadOptimizer>())
+WEBSITEDATASTORE_LOADOPTIMIZER_ADDITIONS_2
#endif
-{
WTF::setProcessPrivileges(allPrivileges());
maybeRegisterWithSessionIDMap();
platformInitialize();
@@ -125,10 +121,10 @@
, m_authenticatorManager(makeUniqueRef<AuthenticatorManager>())
#endif
, m_client(makeUniqueRef<WebsiteDataStoreClient>())
+{
#if HAVE(LOAD_OPTIMIZER)
- , m_loadOptimizer(makeUniqueRef<LoadOptimizer>())
+WEBSITEDATASTORE_LOADOPTIMIZER_ADDITIONS_2
#endif
-{
maybeRegisterWithSessionIDMap();
platformInitialize();
Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (240804 => 240805)
--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2019-01-31 20:01:07 UTC (rev 240805)
@@ -52,6 +52,10 @@
#include <WebCore/CurlProxySettings.h>
#endif
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/WebsiteDataStoreAdditions.h>
+#endif
+
namespace WebCore {
class SecurityOrigin;
}
@@ -59,7 +63,6 @@
namespace WebKit {
class AuthenticatorManager;
-class LoadOptimizer;
class SecKeyProxyStore;
class StorageManager;
class DeviceIdHashSaltStorage;
@@ -227,7 +230,7 @@
void setClient(UniqueRef<WebsiteDataStoreClient>&& client) { m_client = WTFMove(client); }
#if HAVE(LOAD_OPTIMIZER)
- LoadOptimizer& loadOptimizer() { return m_loadOptimizer.get(); }
+WEBSITEDATASTORE_LOADOPTIMIZER_ADDITIONS_1
#endif
private:
@@ -306,10 +309,6 @@
#endif
UniqueRef<WebsiteDataStoreClient> m_client;
-
-#if HAVE(LOAD_OPTIMIZER)
- UniqueRef<LoadOptimizer> m_loadOptimizer;
-#endif
};
}
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (240804 => 240805)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-01-31 20:01:07 UTC (rev 240805)
@@ -1024,7 +1024,6 @@
57597EBD218184900037F924 /* CtapHidAuthenticator.h in Headers */ = {isa = PBXBuildFile; fileRef = 57597EBB2181848F0037F924 /* CtapHidAuthenticator.h */; };
5772F206217DBD6A0056BF2C /* HidService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5772F204217DBD6A0056BF2C /* HidService.h */; };
578DC2982155A0020074E815 /* LocalAuthenticationSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 578DC2972155A0010074E815 /* LocalAuthenticationSoftLink.h */; };
- 57900B4021F8F9B8008317DE /* LoadOptimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 57900B3E21F8F9B8008317DE /* LoadOptimizer.h */; };
57AC8F50217FEED90055438C /* HidConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 57AC8F4E217FEED90055438C /* HidConnection.h */; };
57B4B46020B504AC00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */; };
57DCED6E2142EE5E0016B847 /* WebAuthenticatorCoordinatorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57DCED6B2142EAE20016B847 /* WebAuthenticatorCoordinatorMessageReceiver.cpp */; };
@@ -3375,8 +3374,6 @@
5772F204217DBD6A0056BF2C /* HidService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HidService.h; sourceTree = "<group>"; };
5772F205217DBD6A0056BF2C /* HidService.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HidService.mm; sourceTree = "<group>"; };
578DC2972155A0010074E815 /* LocalAuthenticationSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalAuthenticationSoftLink.h; sourceTree = "<group>"; };
- 57900B3E21F8F9B8008317DE /* LoadOptimizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoadOptimizer.h; sourceTree = "<group>"; };
- 57900B3F21F8F9B8008317DE /* LoadOptimizer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadOptimizer.mm; sourceTree = "<group>"; };
57AC8F4E217FEED90055438C /* HidConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HidConnection.h; sourceTree = "<group>"; };
57AC8F4F217FEED90055438C /* HidConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HidConnection.mm; sourceTree = "<group>"; };
57B4B45D20B504AB00D4AD79 /* AuthenticationManagerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AuthenticationManagerCocoa.mm; sourceTree = "<group>"; };
@@ -5317,8 +5314,6 @@
51C0C9731DDD74F00032CAD3 /* IconLoadingDelegate.mm */,
7A821F4B1E2F664800604577 /* LegacyCustomProtocolManagerClient.h */,
7A821F4D1E2F679E00604577 /* LegacyCustomProtocolManagerClient.mm */,
- 57900B3E21F8F9B8008317DE /* LoadOptimizer.h */,
- 57900B3F21F8F9B8008317DE /* LoadOptimizer.mm */,
411286EF21C8A90C003A8550 /* MediaCaptureUtilities.h */,
411286F021C8A90D003A8550 /* MediaCaptureUtilities.mm */,
1ABC3DF41899E437004F0626 /* NavigationState.h */,
@@ -9122,7 +9117,6 @@
413075AD1DE85F580039EC69 /* LibWebRTCSocket.h in Headers */,
41DC459C1E3DBB2800B11F51 /* LibWebRTCSocketClient.h in Headers */,
413075B21DE85F580039EC69 /* LibWebRTCSocketFactory.h in Headers */,
- 57900B4021F8F9B8008317DE /* LoadOptimizer.h in Headers */,
2D1087611D2C573E00B85F82 /* LoadParameters.h in Headers */,
578DC2982155A0020074E815 /* LocalAuthenticationSoftLink.h in Headers */,
57DCEDAC214C60270016B847 /* LocalAuthenticator.h in Headers */,
Modified: trunk/Tools/ChangeLog (240804 => 240805)
--- trunk/Tools/ChangeLog 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Tools/ChangeLog 2019-01-31 20:01:07 UTC (rev 240805)
@@ -1,3 +1,14 @@
+2019-01-31 Jiewen Tan <jiewen_...@apple.com>
+
+ Formalize WebKitAdditions mechanism of LoadOptimizer
+ https://bugs.webkit.org/show_bug.cgi?id=193886
+ <rdar://problem/47696809>
+
+ Reviewed by Brent Fulgham.
+
+ * MiniBrowser/MiniBrowser.entitlements:
+ Make com.apple.security.temporary-exception.mach-lookup.global-name an array.
+
2019-01-31 Zalan Bujtas <za...@apple.com>
[LFC] Margin before/after/start/end initial value is 0 and not auto.
Modified: trunk/Tools/MiniBrowser/MiniBrowser.entitlements (240804 => 240805)
--- trunk/Tools/MiniBrowser/MiniBrowser.entitlements 2019-01-31 19:52:14 UTC (rev 240804)
+++ trunk/Tools/MiniBrowser/MiniBrowser.entitlements 2019-01-31 20:01:07 UTC (rev 240805)
@@ -5,7 +5,9 @@
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
- <string>com.apple.Safari.SafeBrowsing.Service</string>
+ <array>
+ <string>com.apple.Safari.SafeBrowsing.Service</string>
+ </array>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>