Changeset 273778 in webkit
- Timestamp:
- Mar 2, 2021, 5:56:54 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 added
- 8 edited
-
ChangeLog (modified) (1 diff)
-
Platform/cocoa/ImageExtractionUtilities.h (added)
-
Platform/cocoa/ImageExtractionUtilities.mm (added)
-
SourcesCocoa.txt (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
UIProcess/WebPageProxy.h (modified) (1 diff)
-
WebKit.xcodeproj/project.pbxproj (modified) (5 diffs)
-
WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r273775 r273778 1 2021-03-02 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Image extraction should install image overlay content 4 https://bugs.webkit.org/show_bug.cgi?id=222621 5 6 Reviewed by Tim Horton. 7 8 Take some initial steps towards refactoring image extraction on iOS. See WebKitAdditions for more details. 9 10 * Platform/cocoa/ImageExtractionUtilities.h: Added. 11 * Platform/cocoa/ImageExtractionUtilities.mm: Added. 12 13 Add a new file to contain image-extraction-related functionality; see WebKitAdditions. 14 15 * SourcesCocoa.txt: 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::updateWithImageExtractionResult): 18 * UIProcess/WebPageProxy.h: 19 * UIProcess/ios/WKContentViewInteraction.mm: 20 * WebKit.xcodeproj/project.pbxproj: 21 * WebProcess/WebPage/WebPage.cpp: 22 (WebKit::WebPage::updateWithImageExtractionResult): 23 24 Add IPC plumbing between `WebPageProxy` (in the UI process) and `WebPage` to allow clients to push image 25 extraction results down to a given element on the page. 26 27 * WebProcess/WebPage/WebPage.h: 28 * WebProcess/WebPage/WebPage.messages.in: 29 1 30 2021-03-02 Peng Liu <peng.liu6@apple.com> 2 31 -
trunk/Source/WebKit/SourcesCocoa.txt
r273522 r273778 72 72 Platform/classifier/ResourceLoadStatisticsClassifier.cpp 73 73 74 Platform/cocoa/ImageExtractionUtilities.mm 74 75 Platform/cocoa/LayerHostingContext.mm 75 76 Platform/cocoa/PaymentAuthorizationPresenter.mm -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r273657 r273778 8276 8276 pageClient().requestImageExtraction(imageURL, imageData, WTFMove(completionHandler)); 8277 8277 } 8278 8279 void WebPageProxy::updateWithImageExtractionResult(ImageExtractionResult&& results, const ElementContext& context, const FloatPoint& location, CompletionHandler<void(bool textExistsAtLocation)>&& completionHandler) 8280 { 8281 if (!hasRunningProcess()) { 8282 completionHandler(false); 8283 return; 8284 } 8285 8286 sendWithAsyncReply(Messages::WebPage::UpdateWithImageExtractionResult(WTFMove(results), context, location), WTFMove(completionHandler)); 8287 } 8278 8288 #endif 8279 8289 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r273574 r273778 1623 1623 #if ENABLE(IMAGE_EXTRACTION) 1624 1624 void requestImageExtraction(const URL& imageURL, const ShareableBitmap::Handle& imageData, CompletionHandler<void(WebCore::ImageExtractionResult&&)>&&); 1625 void updateWithImageExtractionResult(WebCore::ImageExtractionResult&&, const WebCore::ElementContext&, const WebCore::FloatPoint& location, CompletionHandler<void(bool textExistsAtLocation)>&&); 1625 1626 #endif 1626 1627 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r273593 r273778 1998 1998 F430E9422247335F005FE053 /* WebsiteMetaViewportPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */; }; 1999 1999 F430E94422473DFF005FE053 /* WebContentMode.h in Headers */ = {isa = PBXBuildFile; fileRef = F430E94322473DB8005FE053 /* WebContentMode.h */; }; 2000 F4351B9E25EEC84C00D63892 /* ImageExtractionUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = F4351B9D25EEC84C00D63892 /* ImageExtractionUtilities.h */; }; 2000 2001 F438CD1C2241421400DE6DDA /* WKWebpagePreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2001 2002 F438CD1F22414D4000DE6DDA /* WKWebpagePreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = F438CD1E22414D4000DE6DDA /* WKWebpagePreferencesInternal.h */; }; … … 5877 5878 F430E941224732A9005FE053 /* WebsiteMetaViewportPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebsiteMetaViewportPolicy.h; sourceTree = "<group>"; }; 5878 5879 F430E94322473DB8005FE053 /* WebContentMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebContentMode.h; sourceTree = "<group>"; }; 5880 F4351B9D25EEC84C00D63892 /* ImageExtractionUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageExtractionUtilities.h; sourceTree = "<group>"; }; 5881 F4351B9F25EEC87800D63892 /* ImageExtractionUtilities.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageExtractionUtilities.mm; sourceTree = "<group>"; }; 5879 5882 F438CD1B224140A600DE6DDA /* WKWebpagePreferences.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebpagePreferences.h; sourceTree = "<group>"; }; 5880 5883 F438CD1D22414AD600DE6DDA /* WKWebpagePreferences.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebpagePreferences.mm; sourceTree = "<group>"; }; … … 8030 8033 51D124861E734AE3002B2820 /* WKHTTPCookieStoreInternal.h */, 8031 8034 DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */, 8032 49917DA6252D649E0050313F /* WKMediaPlaybackState.h */,8033 8035 1AB40EE31BF677E300BA81BE /* WKMenuItemIdentifiers.mm */, 8034 8036 1AB40EE41BF677E300BA81BE /* WKMenuItemIdentifiersPrivate.h */, … … 8362 8364 F4FE0A3C24635667002631E1 /* CocoaFont.h */, 8363 8365 4482734624528F6000A95493 /* CocoaImage.h */, 8366 F4351B9D25EEC84C00D63892 /* ImageExtractionUtilities.h */, 8367 F4351B9F25EEC87800D63892 /* ImageExtractionUtilities.mm */, 8364 8368 BCE0937614FB128B001138D9 /* LayerHostingContext.h */, 8365 8369 BCE0937514FB128B001138D9 /* LayerHostingContext.mm */, … … 11789 11793 51C0C9741DDD76000032CAD3 /* IconLoadingDelegate.h in Headers */, 11790 11794 51E351CB180F2CCC00E53BE9 /* IDBUtilities.h in Headers */, 11795 F4351B9E25EEC84C00D63892 /* ImageExtractionUtilities.h in Headers */, 11791 11796 BCCF6B2512C93E7A008F9C35 /* ImageOptions.h in Headers */, 11792 11797 1A1EC69E1872092100B951F0 /* ImportanceAssertion.h in Headers */, -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r273574 r273778 7259 7259 } 7260 7260 7261 void WebPage::updateWithImageExtractionResult(ImageExtractionResult&& result, const ElementContext& context, const FloatPoint& location, CompletionHandler<void(bool)>&& completionHandler) 7262 { 7263 auto elementToUpdate = elementForContext(context); 7264 if (!is<HTMLElement>(elementToUpdate)) { 7265 completionHandler(false); 7266 return; 7267 } 7268 7269 downcast<HTMLElement>(*elementToUpdate).updateWithImageExtractionResult(WTFMove(result)); 7270 7271 // FIXME: Hit-test with location and return whether or not there is overlay text at the given location. 7272 completionHandler(true); 7273 } 7274 7261 7275 #endif // ENABLE(IMAGE_EXTRACTION) 7262 7276 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r273102 r273778 1378 1378 #if ENABLE(IMAGE_EXTRACTION) 1379 1379 void requestImageExtraction(WebCore::Element&); 1380 void updateWithImageExtractionResult(WebCore::ImageExtractionResult&&, const WebCore::ElementContext&, const WebCore::FloatPoint& location, CompletionHandler<void(bool)>&&); 1380 1381 #endif 1381 1382 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r273102 r273778 634 634 635 635 LastNavigationWasAppBound() -> (bool wasAppBound) Async 636 637 #if ENABLE(IMAGE_EXTRACTION) 638 UpdateWithImageExtractionResult(struct WebCore::ImageExtractionResult result, struct WebCore::ElementContext element, WebCore::FloatPoint location) -> (bool textExistsAtLocation) Async 639 #endif 636 640 }
Note:
See TracChangeset
for help on using the changeset viewer.