Changeset 240555 in webkit
- Timestamp:
- Jan 27, 2019 12:44:05 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240553 r240555 1 2019-01-27 Jiewen Tan <jiewen_tan@apple.com> 2 3 Use a load optimizer for some sites 4 https://bugs.webkit.org/show_bug.cgi?id=193881 5 <rdar://problem/46325455> 6 7 Reviewed by Brent Fulgham. 8 9 Expose FormData::flatten to be used by the load optimizer. 10 11 * WebCore.xcodeproj/project.pbxproj: 12 * platform/network/FormData.h: 13 1 14 2019-01-26 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebCore/platform/network/FormData.h
r239535 r240555 222 222 WEBCORE_EXPORT void appendBlob(const URL& blobURL); 223 223 224 Vector<char> flatten() const; // omits files224 WEBCORE_EXPORT Vector<char> flatten() const; // omits files 225 225 String flattenToString() const; // omits files 226 226 -
trunk/Source/WebKit/ChangeLog
r240554 r240555 1 2019-01-27 Jiewen Tan <jiewen_tan@apple.com> 2 3 Use a load optimizer for some sites 4 https://bugs.webkit.org/show_bug.cgi?id=193881 5 <rdar://problem/46325455> 6 7 Reviewed by Brent Fulgham. 8 9 We will try to speed up some sites with a dedicated load optimizer. The load optimizer lives 10 within the WebsiteDataStore as one client instance should have only one and it should live 11 as long as the client lives. How does the load optimizer work? It intercepts every load in 12 the navigation state. If a request meets some requirements, it will then fetch the request 13 from its own cache. Once the fetch succeeds, the original load will be ignored and the 14 optimizer will display the cached content. 15 16 Covered by API tests. 17 18 * SourcesCocoa.txt: 19 * UIProcess/Cocoa/LoadOptimizer.h: Added. 20 * UIProcess/Cocoa/LoadOptimizer.mm: Added. 21 * UIProcess/Cocoa/MediaCaptureUtilities.h: 22 * UIProcess/Cocoa/NavigationState.mm: 23 (WebKit::tryInterceptNavigation): 24 (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 25 (WebKit::tryAppLink): Deleted. 26 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 27 (WebKit::WebsiteDataStore::WebsiteDataStore): 28 * UIProcess/WebsiteData/WebsiteDataStore.h: 29 (WebKit::WebsiteDataStore::loadOptimizer): 30 * WebKit.xcodeproj/project.pbxproj: 31 1 32 2019-01-25 Brian Burg <bburg@apple.com> 2 33 -
trunk/Source/WebKit/SourcesCocoa.txt
r240311 r240555 324 324 UIProcess/Cocoa/IconLoadingDelegate.mm 325 325 UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm 326 UIProcess/Cocoa/LoadOptimizer.mm 326 327 UIProcess/Cocoa/MediaCaptureUtilities.mm 327 328 UIProcess/Cocoa/NavigationState.mm -
trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.h
r240554 r240555 1 1 /* 2 * Copyright (C) 201 8Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #if WK_API_ENABLED 29 30 #import "WKWebViewPrivate.h" 31 #import <WebCore/MediaProducer.h> 32 33 namespace WebKit { 34 35 _WKMediaCaptureState toWKMediaCaptureState(WebCore::MediaProducer::MediaStateFlags); 36 37 } // namespace WebKit 38 28 #if HAVE(LOAD_OPTIMIZER) 29 #include <WebKitAdditions/LoadOptimizerAdditions.h> 39 30 #endif -
trunk/Source/WebKit/UIProcess/Cocoa/LoadOptimizer.mm
r240554 r240555 1 1 /* 2 * Copyright (C) 201 8Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #pragma once 26 #import "config.h" 27 #import "LoadOptimizer.h" 27 28 28 #if WK_API_ENABLED 29 30 #import "WKWebViewPrivate.h" 31 #import <WebCore/MediaProducer.h> 32 33 namespace WebKit { 34 35 _WKMediaCaptureState toWKMediaCaptureState(WebCore::MediaProducer::MediaStateFlags); 36 37 } // namespace WebKit 38 29 #if HAVE(LOAD_OPTIMIZER) 30 #import <WebKitAdditions/LoadOptimizerAdditions.mm> 39 31 #endif -
trunk/Source/WebKit/UIProcess/Cocoa/MediaCaptureUtilities.h
r240100 r240555 26 26 #pragma once 27 27 28 #import "WKFoundation.h" 29 28 30 #if WK_API_ENABLED 29 31 -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
r240477 r240555 38 38 #import "AuthenticationDecisionListener.h" 39 39 #import "CompletionHandlerCallChecker.h" 40 #import "LoadOptimizer.h" 40 41 #import "Logging.h" 41 42 #import "NavigationActionData.h" … … 465 466 #endif 466 467 467 static void try AppLink(Ref<API::NavigationAction>&& navigationAction, WTF::Function<void(bool)>&& completionHandler)468 static void tryInterceptNavigation(Ref<API::NavigationAction>&& navigationAction, WebPageProxy& page, WTF::Function<void(bool)>&& completionHandler) 468 469 { 469 470 #if HAVE(APP_LINKS) 470 if (!navigationAction->shouldOpenAppLinks()) { 471 completionHandler(false); 472 return; 473 } 474 475 auto* localCompletionHandler = new WTF::Function<void (bool)>(WTFMove(completionHandler)); 476 [LSAppLink openWithURL:navigationAction->request().url() completionHandler:[localCompletionHandler](BOOL success, NSError *) { 477 dispatch_async(dispatch_get_main_queue(), [localCompletionHandler, success] { 478 (*localCompletionHandler)(success); 479 delete localCompletionHandler; 480 }); 481 }]; 482 #else 471 if (navigationAction->shouldOpenAppLinks()) { 472 auto* localCompletionHandler = new WTF::Function<void (bool)>(WTFMove(completionHandler)); 473 [LSAppLink openWithURL:navigationAction->request().url() completionHandler:[localCompletionHandler](BOOL success, NSError *) { 474 dispatch_async(dispatch_get_main_queue(), [localCompletionHandler, success] { 475 (*localCompletionHandler)(success); 476 delete localCompletionHandler; 477 }); 478 }]; 479 return; 480 } 481 #endif 482 483 #if HAVE(LOAD_OPTIMIZER) 484 if (LoadOptimizer::canOptimizeLoad(navigationAction->request().url())) { 485 page.websiteDataStore().loadOptimizer().optimizeLoad(navigationAction->request(), page, WTFMove(completionHandler)); 486 return; 487 } 488 #endif 489 483 490 completionHandler(false); 484 #endif485 491 } 486 492 … … 492 498 && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies 493 499 && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies) { 494 auto completionHandler = [webPage = makeRef(webPageProxy), listener = WTFMove(listener), navigationAction = navigationAction.copyRef()] (bool followedLinkToApp) {495 if ( followedLinkToApp) {500 auto completionHandler = [webPage = makeRef(webPageProxy), listener = WTFMove(listener), navigationAction = navigationAction.copyRef()] (bool interceptedNavigation) { 501 if (interceptedNavigation) { 496 502 listener->ignore(); 497 503 return; … … 520 526 listener->ignore(); 521 527 }; 522 try AppLink(WTFMove(navigationAction), WTFMove(completionHandler));528 tryInterceptNavigation(WTFMove(navigationAction), webPageProxy, WTFMove(completionHandler)); 523 529 return; 524 530 } … … 555 561 case WKNavigationActionPolicyAllow: 556 562 case _WKNavigationActionPolicyAllowInNewProcess: 557 try AppLink(WTFMove(navigationAction), [actionPolicy, localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)](bool followedLinkToApp) mutable {558 if ( followedLinkToApp) {563 tryInterceptNavigation(WTFMove(navigationAction), webPageProxy, [actionPolicy, localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)](bool interceptedNavigation) mutable { 564 if (interceptedNavigation) { 559 565 localListener->ignore(); 560 566 return; -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r240498 r240555 58 58 #include <wtf/RunLoop.h> 59 59 60 #if HAVE(LOAD_OPTIMIZER) 61 #include "LoadOptimizer.h" 62 #endif 63 60 64 #if ENABLE(NETSCAPE_PLUGIN_API) 61 65 #include "PluginProcessManager.h" … … 102 106 #endif 103 107 , m_client(makeUniqueRef<WebsiteDataStoreClient>()) 108 #if HAVE(LOAD_OPTIMIZER) 109 , m_loadOptimizer(makeUniqueRef<LoadOptimizer>()) 110 #endif 104 111 { 105 112 WTF::setProcessPrivileges(allPrivileges()); … … 120 127 #endif 121 128 , m_client(makeUniqueRef<WebsiteDataStoreClient>()) 129 #if HAVE(LOAD_OPTIMIZER) 130 , m_loadOptimizer(makeUniqueRef<LoadOptimizer>()) 131 #endif 122 132 { 123 133 maybeRegisterWithSessionIDMap(); -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r240360 r240555 60 60 61 61 class AuthenticatorManager; 62 class LoadOptimizer; 62 63 class SecKeyProxyStore; 63 64 class StorageManager; … … 238 239 void setClient(UniqueRef<WebsiteDataStoreClient>&& client) { m_client = WTFMove(client); } 239 240 241 #if HAVE(LOAD_OPTIMIZER) 242 LoadOptimizer& loadOptimizer() { return m_loadOptimizer.get(); } 243 #endif 244 240 245 private: 241 246 explicit WebsiteDataStore(PAL::SessionID); … … 315 320 316 321 UniqueRef<WebsiteDataStoreClient> m_client; 322 323 #if HAVE(LOAD_OPTIMIZER) 324 UniqueRef<LoadOptimizer> m_loadOptimizer; 325 #endif 317 326 }; 318 327 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r240554 r240555 1024 1024 5772F206217DBD6A0056BF2C /* HidService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5772F204217DBD6A0056BF2C /* HidService.h */; }; 1025 1025 578DC2982155A0020074E815 /* LocalAuthenticationSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 578DC2972155A0010074E815 /* LocalAuthenticationSoftLink.h */; }; 1026 57900B4021F8F9B8008317DE /* LoadOptimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 57900B3E21F8F9B8008317DE /* LoadOptimizer.h */; }; 1026 1027 57AC8F50217FEED90055438C /* HidConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 57AC8F4E217FEED90055438C /* HidConnection.h */; }; 1027 1028 57B4B46020B504AC00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */; }; … … 3373 3374 5772F205217DBD6A0056BF2C /* HidService.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HidService.mm; sourceTree = "<group>"; }; 3374 3375 578DC2972155A0010074E815 /* LocalAuthenticationSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalAuthenticationSoftLink.h; sourceTree = "<group>"; }; 3376 57900B3E21F8F9B8008317DE /* LoadOptimizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoadOptimizer.h; sourceTree = "<group>"; }; 3377 57900B3F21F8F9B8008317DE /* LoadOptimizer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadOptimizer.mm; sourceTree = "<group>"; }; 3375 3378 57AC8F4E217FEED90055438C /* HidConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HidConnection.h; sourceTree = "<group>"; }; 3376 3379 57AC8F4F217FEED90055438C /* HidConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = HidConnection.mm; sourceTree = "<group>"; }; … … 5315 5318 411286EF21C8A90C003A8550 /* MediaCaptureUtilities.h */, 5316 5319 411286F021C8A90D003A8550 /* MediaCaptureUtilities.mm */, 5320 57900B3E21F8F9B8008317DE /* LoadOptimizer.h */, 5321 57900B3F21F8F9B8008317DE /* LoadOptimizer.mm */, 5317 5322 1ABC3DF41899E437004F0626 /* NavigationState.h */, 5318 5323 1ABC3DF31899E437004F0626 /* NavigationState.mm */, … … 9916 9921 BC8699B5116AADAA002A925B /* WKView.h in Headers */, 9917 9922 BC8699B7116AADAA002A925B /* WKViewInternal.h in Headers */, 9923 57900B4021F8F9B8008317DE /* LoadOptimizer.h in Headers */, 9918 9924 2D28A4971AF965A100F190C9 /* WKViewLayoutStrategy.h in Headers */, 9919 9925 BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */, -
trunk/Tools/ChangeLog
r240552 r240555 1 2019-01-27 Jiewen Tan <jiewen_tan@apple.com> 2 3 Use a load optimizer for some sites 4 https://bugs.webkit.org/show_bug.cgi?id=193881 5 <rdar://problem/46325455> 6 7 Reviewed by Brent Fulgham. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm: Added. 11 1 12 2019-01-27 Chris Fleizach <cfleizach@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r240450 r240555 282 282 57599E2B1F071AA000A3FB8C /* IndexedDBStructuredCloneBackwardCompatibilityWrite.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57599E231F07192C00A3FB8C /* IndexedDBStructuredCloneBackwardCompatibilityWrite.html */; }; 283 283 5769C50B1D9B0002000847FB /* SerializedCryptoKeyWrap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5769C50A1D9B0001000847FB /* SerializedCryptoKeyWrap.mm */; }; 284 5774AA6821FBBF7800AF2A1B /* TestLoadOptimizer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5774AA6721FBBF7800AF2A1B /* TestLoadOptimizer.mm */; }; 284 285 578CBD67204FB2C80083B9F2 /* LocalAuthentication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 578CBD66204FB2C70083B9F2 /* LocalAuthentication.framework */; }; 285 286 57901FB11CAF142D00ED64F9 /* LoadInvalidURLRequest.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 57901FB01CAF141C00ED64F9 /* LoadInvalidURLRequest.html */; }; … … 1654 1655 57599E261F07192C00A3FB8C /* IndexedDBStructuredCloneBackwardCompatibility.sqlite3-shm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IndexedDBStructuredCloneBackwardCompatibility.sqlite3-shm"; sourceTree = "<group>"; }; 1655 1656 5769C50A1D9B0001000847FB /* SerializedCryptoKeyWrap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedCryptoKeyWrap.mm; sourceTree = "<group>"; }; 1657 5774AA6721FBBF7800AF2A1B /* TestLoadOptimizer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestLoadOptimizer.mm; sourceTree = "<group>"; }; 1656 1658 578CBD66204FB2C70083B9F2 /* LocalAuthentication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LocalAuthentication.framework; path = System/Library/Frameworks/LocalAuthentication.framework; sourceTree = SDKROOT; }; 1657 1659 57901FAC1CAF12C200ED64F9 /* LoadInvalidURLRequest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadInvalidURLRequest.mm; sourceTree = "<group>"; }; … … 2510 2512 4612C2B8210A6ABF00B788A6 /* LoadFileThenReload.mm */, 2511 2513 57901FAC1CAF12C200ED64F9 /* LoadInvalidURLRequest.mm */, 2514 5774AA6721FBBF7800AF2A1B /* TestLoadOptimizer.mm */, 2512 2515 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */, 2513 2516 CA38459520AE012E00990D3B /* LocalStorageDatabaseTracker.mm */, … … 4253 4256 7CCE7F2D1A411B1000447C4C /* UserContentTest.mm in Sources */, 4254 4257 7C882E0A1C80C764006BF731 /* UserContentWorld.mm in Sources */, 4258 5774AA6821FBBF7800AF2A1B /* TestLoadOptimizer.mm in Sources */, 4255 4259 7CCB99211D3B41F6003922F6 /* UserInitiatedActionInNavigationAction.mm in Sources */, 4256 4260 7CCE7F171A411AE600447C4C /* UserMedia.cpp in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm
r240554 r240555 1 1 /* 2 * Copyright (C) 201 8Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 # pragma once26 #import "config.h" 27 27 28 #if WK_API_ENABLED 29 30 #import "WKWebViewPrivate.h" 31 #import <WebCore/MediaProducer.h> 32 33 namespace WebKit { 34 35 _WKMediaCaptureState toWKMediaCaptureState(WebCore::MediaProducer::MediaStateFlags); 36 37 } // namespace WebKit 38 28 #if HAVE(LOAD_OPTIMIZER) 29 #import <WebKitAdditions/TestLoadOptimizerAdditions.mm> 39 30 #endif
Note: See TracChangeset
for help on using the changeset viewer.