WebKit Bugzilla
Attachment 360739 Details for
Bug 193886
: Formalize WebKitAdditions mechanism of LoadOptimizer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
WIP.patch (text/plain), 17.02 KB, created by
Jiewen Tan
on 2019-01-31 10:19:08 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jiewen Tan
Created:
2019-01-31 10:19:08 PST
Size:
17.02 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1534bcd1a43..ebfd76b8807 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-31 Jiewen Tan <jiewen_tan@apple.com> >+ >+ Formalize WebKitAdditions mechanism of LoadOptimizer >+ https://bugs.webkit.org/show_bug.cgi?id=193886 >+ <rdar://problem/47696809> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by existing tests. >+ >+ * platform/network/ResourceRequestBase.h: >+ Export isolatedCopy(). >+ > 2019-01-29 Andy Estes <aestes@apple.com> > > Try to fix the watchOS build. >diff --git a/Source/WebCore/platform/network/ResourceRequestBase.h b/Source/WebCore/platform/network/ResourceRequestBase.h >index b470274b115..927f43aca96 100644 >--- a/Source/WebCore/platform/network/ResourceRequestBase.h >+++ b/Source/WebCore/platform/network/ResourceRequestBase.h >@@ -57,7 +57,7 @@ class ResourceResponse; > 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; >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 878066d54b7..5ef2e723f4a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,28 @@ >+2019-01-31 Jiewen Tan <jiewen_tan@apple.com> >+ >+ Formalize WebKitAdditions mechanism of LoadOptimizer >+ https://bugs.webkit.org/show_bug.cgi?id=193886 >+ <rdar://problem/47696809> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-29 Youenn Fablet <youenn@apple.com> > > Adopt new SPI to evaluate server certificate trust >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index cbf2e9deab3..1cf82493107 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -324,7 +324,6 @@ UIProcess/Cocoa/FullscreenClient.mm > 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 >diff --git a/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h b/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h >deleted file mode 100644 >index acecf045e8c..00000000000 >--- a/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h >+++ /dev/null >@@ -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 >diff --git a/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm b/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm >deleted file mode 100644 >index 215cebfd9dc..00000000000 >--- a/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm >+++ /dev/null >@@ -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 >diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >index 6a47ceae93c..f444796a235 100644 >--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm >@@ -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 @@ bool NavigationState::NavigationClient::willGoToBackForwardListItem(WebPageProxy > } > #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) >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index a0f8f68f7eb..f616c060995 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -57,10 +57,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 >@@ -105,10 +101,10 @@ WebsiteDataStore::WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&& configur > , 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(); >@@ -126,10 +122,10 @@ WebsiteDataStore::WebsiteDataStore(PAL::SessionID sessionID) > , m_authenticatorManager(makeUniqueRef<AuthenticatorManager>()) > #endif > , m_client(makeUniqueRef<WebsiteDataStoreClient>()) >+{ > #if HAVE(LOAD_OPTIMIZER) >- , m_loadOptimizer(makeUniqueRef<LoadOptimizer>()) >+WEBSITEDATASTORE_LOADOPTIMIZER_ADDITIONS_2 > #endif >-{ > maybeRegisterWithSessionIDMap(); > platformInitialize(); > >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >index db652e60bba..e48bf8b7e7a 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >@@ -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 @@ class SecurityOrigin; > namespace WebKit { > > class AuthenticatorManager; >-class LoadOptimizer; > class SecKeyProxyStore; > class StorageManager; > class DeviceIdHashSaltStorage; >@@ -228,7 +231,7 @@ public: > 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: >@@ -303,10 +306,6 @@ private: > #endif > > UniqueRef<WebsiteDataStoreClient> m_client; >- >-#if HAVE(LOAD_OPTIMIZER) >- UniqueRef<LoadOptimizer> m_loadOptimizer; >-#endif > }; > > } >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 2a22d55fae7..0ef8bb04399 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -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 */, >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 88f1c2a4693..aeae31df2f0 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-31 Jiewen Tan <jiewen_tan@apple.com> >+ >+ Formalize WebKitAdditions mechanism of LoadOptimizer >+ https://bugs.webkit.org/show_bug.cgi?id=193886 >+ <rdar://problem/47696809> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * MiniBrowser/MiniBrowser.entitlements: >+ Make com.apple.security.temporary-exception.mach-lookup.global-name an array. >+ > 2019-01-29 Youenn Fablet <youenn@apple.com> > > Adopt new SPI to evaluate server certificate trust >diff --git a/Tools/MiniBrowser/MiniBrowser.entitlements b/Tools/MiniBrowser/MiniBrowser.entitlements >index e085f4ea759..e6e5a9dd39f 100644 >--- a/Tools/MiniBrowser/MiniBrowser.entitlements >+++ b/Tools/MiniBrowser/MiniBrowser.entitlements >@@ -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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193886
:
360709
| 360739