Changeset 260407 in webkit
- Timestamp:
- Apr 20, 2020 5:27:46 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/wtf/PlatformHave.h
r260182 r260407 678 678 #define HAVE_MEDIA_USAGE_FRAMEWORK 1 679 679 #endif 680 681 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY) 682 #define HAVE_QUICKLOOK_THUMBNAILING 1 683 #endif -
trunk/Source/WebCore/ChangeLog
r260404 r260407 1 2020-04-20 Nikos Mouchtaris <nmouchtaris@apple.com> 2 3 WK2 Quicklook for attachments 4 https://bugs.webkit.org/show_bug.cgi?id=208891 5 6 Reviewed by Darin Adler. 7 8 Added to HTMLAttachmentElement to have member image representing 9 QuickLook thumbnail. Added code to render this image on both iOS and Mac. 10 11 No new tests. Test will be added after additions to test infrastructure. 12 13 * html/HTMLAttachmentElement.cpp: 14 (WebCore::HTMLAttachmentElement::updateThumbnailRepresentation): 15 Allow setting of thumbnail member. 16 * html/HTMLAttachmentElement.h: 17 * rendering/RenderThemeIOS.mm: 18 Added rendering of image member of attachment element. 19 (WebCore::RenderAttachmentInfo::RenderAttachmentInfo): 20 (WebCore::paintAttachmentIcon): 21 (WebCore::RenderThemeIOS::paintAttachment): 22 * rendering/RenderThemeMac.mm: 23 (WebCore::paintAttachmentIcon): 24 1 25 2020-04-20 Yusuke Suzuki <ysuzuki@apple.com> 2 26 -
trunk/Source/WebCore/html/HTMLAttachmentElement.cpp
r253762 r260407 250 250 } 251 251 252 void HTMLAttachmentElement::updateThumbnail(const RefPtr<Image>& thumbnail) 253 { 254 m_thumbnail = thumbnail; 255 256 if (auto* renderer = this->renderer()) 257 renderer->invalidate(); 258 } 259 252 260 } // namespace WebCore 253 261 -
trunk/Source/WebCore/html/HTMLAttachmentElement.h
r246490 r260407 34 34 class File; 35 35 class HTMLImageElement; 36 class Image; 36 37 class RenderAttachment; 38 class ShareableBitmap; 37 39 class SharedBuffer; 38 40 … … 57 59 WEBCORE_EXPORT void updateAttributes(Optional<uint64_t>&& newFileSize, const String& newContentType, const String& newFilename); 58 60 WEBCORE_EXPORT void updateEnclosingImageWithData(const String& contentType, Ref<SharedBuffer>&& data); 61 WEBCORE_EXPORT void updateThumbnail(const RefPtr<Image>& thumbnail); 59 62 60 63 InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; … … 68 71 String attachmentType() const; 69 72 String attachmentPath() const; 70 73 RefPtr<Image> thumbnail() const { return m_thumbnail; } 71 74 RenderAttachment* renderer() const; 72 75 … … 88 91 RefPtr<File> m_file; 89 92 String m_uniqueIdentifier; 93 RefPtr<Image> m_thumbnail; 90 94 }; 91 95 -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r259703 r260407 1620 1620 1621 1621 RetainPtr<UIImage> icon; 1622 RefPtr<Image> thumbnailIcon; 1622 1623 1623 1624 int baseline { 0 }; … … 1804 1805 FloatSize iconSize; 1805 1806 icon = iconForAttachment(attachment, iconSize); 1806 if (icon) { 1807 iconRect = FloatRect(FloatPoint((attachmentRect.width() / 2) - (iconSize.width() / 2), 0), iconSize); 1807 thumbnailIcon = attachment.attachmentElement().thumbnail(); 1808 1809 if (thumbnailIcon || icon) { 1810 auto visibleIconSize = thumbnailIcon ? FloatSize(attachmentIconSize, attachmentIconSize) : iconSize; 1811 iconRect = FloatRect(FloatPoint((attachmentRect.width() / 2) - (visibleIconSize.width() / 2), 0), visibleIconSize); 1808 1812 yOffset += iconRect.height() + attachmentItemMargin; 1809 1813 } … … 1840 1844 static void paintAttachmentIcon(GraphicsContext& context, RenderAttachmentInfo& info) 1841 1845 { 1842 if (!info.icon) 1843 return; 1844 1845 auto iconImage = BitmapImage::create([info.icon CGImage]); 1846 context.drawImage(iconImage.get(), info.iconRect); 1846 RefPtr<Image> iconImage; 1847 if (info.thumbnailIcon) 1848 iconImage = info.thumbnailIcon; 1849 else if (info.icon) 1850 iconImage = BitmapImage::create([info.icon CGImage]); 1851 1852 context.drawImage(*iconImage, info.iconRect); 1847 1853 } 1848 1854 … … 1920 1926 if (info.hasProgress) 1921 1927 paintAttachmentProgress(context, info); 1922 else if (info.icon )1928 else if (info.icon || info.thumbnailIcon) 1923 1929 paintAttachmentIcon(context, info); 1924 1930 -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r259575 r260407 2778 2778 static void paintAttachmentIcon(const RenderAttachment& attachment, GraphicsContext& context, AttachmentLayout& layout) 2779 2779 { 2780 if (auto thumbnailIcon = attachment.attachmentElement().thumbnail()) { 2781 context.drawImage(*thumbnailIcon, layout.iconRect); 2782 return; 2783 } 2780 2784 auto icon = iconForAttachment(attachment); 2781 2785 if (!icon) -
trunk/Source/WebKit/ChangeLog
r260405 r260407 1 2020-04-20 Nikos Mouchtaris <nmouchtaris@apple.com> 2 3 WK2 Quicklook for attachments 4 https://bugs.webkit.org/show_bug.cgi?id=208891 5 6 Reviewed by Darin Adler. 7 8 Allow attachment elements to render QuickLook thumbnail generated 9 from contents of the file as its icon, rather than the default 10 icons associated with each mime type. 11 12 * Configurations/WebKit.xcconfig: 13 Link QuickLook thumbnailing framework. 14 * UIProcess/API/APIAttachment.h: 15 * UIProcess/API/Cocoa/WKWebView.mm: 16 (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): 17 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 18 Create thumbnail request and add to queue. 19 (WebKit::convertNSImageToBitmap): 20 (WebKit::convertUIImageToBitmap): 21 (WebKit::WebPageProxy::getQLThumbnailForGenerationRequestion): 22 (WebKit::WebPageProxy::getQLThumbnailForFileWrapper): 23 (WebKit::WebPageProxy::getQLThumbnailForAttachment): 24 * UIProcess/QLThumbnailLoad.h: Added. 25 * UIProcess/QLThumbnailLoad.mm: Added. 26 Add code to request thumbnail for file data. 27 (-[WKQLThumbnailQueueManager init]): 28 (+[WKQLThumbnailQueueManager sharedInstance]): 29 (-[WKQLThumbnailLoadOperation initWithAttachment:identifier:]): 30 (-[WKQLThumbnailLoadOperation initWithURL:identifier:]): 31 (-[WKQLThumbnailLoadOperation start]): 32 (-[WKQLThumbnailLoadOperation isAsynchronous]): 33 (-[WKQLThumbnailLoadOperation isExecuting]): 34 (-[WKQLThumbnailLoadOperation setExecuting:]): 35 (-[WKQLThumbnailLoadOperation isFinished]): 36 (-[WKQLThumbnailLoadOperation setFinished:]): 37 * UIProcess/WebPageProxy.cpp: 38 * UIProcess/WebPageProxy.h: 39 * WebKit.xcodeproj/project.pbxproj: 40 * WebProcess/WebPage/WebPage.cpp: 41 (WebKit::WebPage::updateAttachmentIcon): 42 Set thumbnail of attachment element 43 * WebProcess/WebPage/WebPage.h: 44 * WebProcess/WebPage/WebPage.messages.in: 45 Thumbnail request message. 46 1 47 2020-04-20 Kate Cheney <katherine_cheney@apple.com> 2 48 -
trunk/Source/WebKit/Configurations/WebKit.xcconfig
r260334 r260407 125 125 WK_AUTHKIT_LDFLAGS_MACOS_SINCE_1015 = -framework AuthKit; 126 126 127 FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_RUNNINGBOARD_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS); 127 WK_QUICKLOOK_THUMBNAILING_LDFLAGS = $(WK_QUICKLOOK_THUMBNAILING_LDFLAGS_$(WK_PLATFORM_NAME)); 128 WK_QUICKLOOK_THUMBNAILING_LDFLAGS_macosx = $(WK_QUICKLOOK_THUMBNAILING_LDFLAGS$(WK_MACOS_1015)); 129 WK_QUICKLOOK_THUMBNAILING_LDFLAGS_MACOS_SINCE_1015 = -framework QuickLookThumbnailing; 130 WK_QUICKLOOK_THUMBNAILING_LDFLAGS_iphoneos = -framework QuickLookThumbnailing; 131 WK_QUICKLOOK_THUMBNAILING_LDFLAGS_iphonesimulator = -framework QuickLookThumbnailing; 132 133 FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -framework QuickLookThumbnailing -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_RUNNINGBOARD_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS) $(WK_QUICKLOOK_THUMBNAILING_LDFLAGS); 128 134 129 135 // Prevent C++ standard library basic_stringstream, operator new, delete and their related exception types from being exported as weak symbols. -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r260350 r260407 47 47 #import "PageClient.h" 48 48 #import "ProvisionalPageProxy.h" 49 #import "QuickLookThumbnailLoader.h" 49 50 #import "RemoteLayerTreeScrollingPerformanceData.h" 50 51 #import "RemoteObjectRegistry.h" … … 2161 2162 capturedHandler(error == WebKit::CallbackBase::Error::None); 2162 2163 }); 2163 2164 #if HAVE(QUICKLOOK_THUMBNAILING) 2165 _page->requestThumbnailWithFileWrapper(fileWrapper, identifier); 2166 #endif 2164 2167 return wrapper(attachment); 2165 2168 #else -
trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
r260366 r260407 34 34 #import "LoadParameters.h" 35 35 #import "PageClient.h" 36 #import "QuickLookThumbnailLoader.h" 36 37 #import "SafeBrowsingSPI.h" 37 38 #import "SafeBrowsingWarning.h" … … 388 389 #endif 389 390 391 #if HAVE(QUICKLOOK_THUMBNAILING) 392 #if PLATFORM(MAC) 393 using PlatformImage = NSImage*; 394 #elif PLATFORM(IOS_FAMILY) 395 using PlatformImage = UIImage*; 396 #endif 397 398 static RefPtr<WebKit::ShareableBitmap> convertPlatformImageToBitmap(PlatformImage image, const WebCore::IntSize& size) 399 { 400 WebKit::ShareableBitmap::Configuration bitmapConfiguration; 401 auto bitmap = WebKit::ShareableBitmap::createShareable(size, bitmapConfiguration); 402 if (!bitmap) 403 return nullptr; 404 405 auto graphicsContext = bitmap->createGraphicsContext(); 406 if (!graphicsContext) 407 return nullptr; 408 #if PLATFORM(IOS_FAMILY) 409 UIGraphicsPushContext(graphicsContext->platformContext()); 410 [image drawInRect:CGRectMake(0, 0, bitmap->size().width(), bitmap->size().height())]; 411 UIGraphicsPopContext(); 412 #elif PLATFORM(MAC) 413 auto savedContext = adoptNS([NSGraphicsContext currentContext]); 414 415 [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithCGContext:graphicsContext->platformContext() flipped:YES]]; 416 [image drawInRect:NSMakeRect(0, 0, bitmap->size().width(), bitmap->size().height()) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1 respectFlipped:YES hints:nil]; 417 418 [NSGraphicsContext setCurrentContext:savedContext.get()]; 419 #endif 420 return bitmap; 421 } 422 423 void WebPageProxy::requestThumbnailWithOperation(WKQLThumbnailLoadOperation *operation) 424 { 425 [operation setCompletionBlock:^{ 426 dispatch_async(dispatch_get_main_queue(), ^{ 427 auto identifier = [operation identifier]; 428 auto convertedImage = convertPlatformImageToBitmap([operation thumbnail], WebCore::IntSize(400, 400)); 429 if (!convertedImage) 430 return; 431 this->updateAttachmentIcon(identifier, convertedImage); 432 }); 433 }]; 434 435 [[WKQLThumbnailQueueManager sharedInstance].qlThumbnailGenerationQueue addOperation:operation]; 436 } 437 438 439 void WebPageProxy::requestThumbnailWithFileWrapper(NSFileWrapper* fileWrapper, const String& identifier) 440 { 441 auto operation = adoptNS([[WKQLThumbnailLoadOperation alloc] initWithAttachment:fileWrapper identifier:identifier]); 442 requestThumbnailWithOperation(operation.get()); 443 } 444 445 void WebPageProxy::requestThumbnailWithPath(const String& identifier, const String& filePath) 446 { 447 auto operation = adoptNS([[WKQLThumbnailLoadOperation alloc] initWithURL:filePath identifier:identifier]); 448 requestThumbnailWithOperation(operation.get()); 449 450 } 451 452 #endif 390 453 } // namespace WebKit 391 454 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r260405 r260407 9496 9496 } 9497 9497 9498 #if HAVE(QUICKLOOK_THUMBNAILING) 9499 void WebPageProxy::updateAttachmentIcon(const String& identifier, const RefPtr<ShareableBitmap>& bitmap) 9500 { 9501 if (!hasRunningProcess()) 9502 return; 9503 9504 ShareableBitmap::Handle handle; 9505 if (bitmap) 9506 bitmap->createHandle(handle); 9507 9508 send(Messages::WebPage::UpdateAttachmentIcon(identifier, handle)); 9509 } 9510 #endif 9511 9498 9512 void WebPageProxy::registerAttachmentIdentifierFromData(const String& identifier, const String& contentType, const String& preferredFileName, const IPC::SharedBufferDataReference& data) 9499 9513 { … … 9523 9537 attachment->setFilePath(filePath); 9524 9538 m_attachmentIdentifierToAttachmentMap.set(identifier, attachment.copyRef()); 9525 9526 9539 platformRegisterAttachment(WTFMove(attachment), filePath); 9540 #if HAVE(QUICKLOOK_THUMBNAILING) 9541 requestThumbnailWithPath(identifier, filePath); 9542 #endif 9527 9543 } 9528 9544 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r260381 r260407 202 202 class SharedBufferDataReference; 203 203 } 204 OBJC_CLASS NSFileWrapper; 205 OBJC_CLASS WKQLThumbnailLoadOperation; 204 206 205 207 namespace WebCore { … … 1597 1599 void registerAttachmentIdentifier(const String&); 1598 1600 void didInvalidateDataForAttachment(API::Attachment&); 1599 1601 #if HAVE(QUICKLOOK_THUMBNAILING) 1602 void updateAttachmentIcon(const String&, const RefPtr<ShareableBitmap>&); 1603 void requestThumbnailWithPath(const String&, const String&); 1604 void requestThumbnailWithFileWrapper(NSFileWrapper*, const String&); 1605 void requestThumbnailWithOperation(WKQLThumbnailLoadOperation*); 1606 #endif 1600 1607 enum class ShouldUpdateAttachmentAttributes : bool { No, Yes }; 1601 1608 ShouldUpdateAttachmentAttributes willUpdateAttachmentAttributes(const API::Attachment&); -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r260381 r260407 165 165 1A07D2FA1919B3A900ECDA16 /* model.py in Copy Message Generation Scripts */ = {isa = PBXBuildFile; fileRef = 0FC08570187CE0A900780D86 /* model.py */; }; 166 166 1A07D2FB1919B3A900ECDA16 /* parser.py in Copy Message Generation Scripts */ = {isa = PBXBuildFile; fileRef = 0FC08571187CE0A900780D86 /* parser.py */; }; 167 1A0C225E243575CD00ED614D /* QuickLookThumbnailLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEE57242409F142002005D6 /* QuickLookThumbnailLoader.mm */; }; 167 168 1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC601124A9F2C007EF4A5 /* PluginProcessManager.h */; }; 168 169 1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0EC6BE124BBD9B007EF4A5 /* PluginProcessMessages.h */; }; … … 380 381 1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE49A4711FFA8CE0048B464 /* JSNPMethod.h */; }; 381 382 1AE52F981920267200A1FA37 /* WKContextConfigurationRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE52F9419201F6B00A1FA37 /* WKContextConfigurationRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; 383 1AEE57252409F142002005D6 /* QuickLookThumbnailLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEE57232409F142002005D6 /* QuickLookThumbnailLoader.h */; }; 382 384 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEFCC1011D01F96008219D3 /* PluginInfoStore.h */; }; 383 385 1AEFD27911D16C81008219D3 /* ArgumentCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEFD27811D16C81008219D3 /* ArgumentCoder.h */; }; … … 2664 2666 1AE52F9419201F6B00A1FA37 /* WKContextConfigurationRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextConfigurationRef.h; sourceTree = "<group>"; }; 2665 2667 1AE5B7F911E7AED200BA6767 /* NetscapePluginMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginMac.mm; sourceTree = "<group>"; }; 2668 1AEE57232409F142002005D6 /* QuickLookThumbnailLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QuickLookThumbnailLoader.h; sourceTree = "<group>"; }; 2669 1AEE57242409F142002005D6 /* QuickLookThumbnailLoader.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = QuickLookThumbnailLoader.mm; sourceTree = "<group>"; }; 2666 2670 1AEFCC1011D01F96008219D3 /* PluginInfoStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginInfoStore.h; sourceTree = "<group>"; }; 2667 2671 1AEFCC1111D01F96008219D3 /* PluginInfoStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginInfoStore.cpp; sourceTree = "<group>"; }; … … 8934 8938 4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */, 8935 8939 4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */, 8940 1AEE57232409F142002005D6 /* QuickLookThumbnailLoader.h */, 8941 1AEE57242409F142002005D6 /* QuickLookThumbnailLoader.mm */, 8936 8942 BC111B08112F5E3C00337BAB /* ResponsivenessTimer.cpp */, 8937 8943 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */, … … 11000 11006 83048AE61ACA45DC0082C832 /* ProcessThrottlerClient.h in Headers */, 11001 11007 A1E688701F6E2BAB007006A6 /* QuarantineSPI.h in Headers */, 11008 1AEE57252409F142002005D6 /* QuickLookThumbnailLoader.h in Headers */, 11002 11009 57FD318222B3515E008D0E8B /* RedirectSOAuthorizationSession.h in Headers */, 11003 11010 9B1229D223FF2BCC008CA751 /* RemoteAudioDestinationIdentifier.h in Headers */, … … 11328 11335 BCE0E425168B7A280057E66A /* WebProcessSupplement.h in Headers */, 11329 11336 1A1E093418861D3800D2DC49 /* WebProgressTrackerClient.h in Headers */, 11330 5109099723DACBF2003B1E4C /* WKScriptMessageHandlerWithReply.h in Headers */,11331 11337 512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */, 11332 11338 461CCCA6231485AA00B659B9 /* WebRemoteObjectRegistry.h in Headers */, … … 11682 11688 1A7E377918E4A4FE003D0FFF /* WKScriptMessage.h in Headers */, 11683 11689 1A7E377518E4A33A003D0FFF /* WKScriptMessageHandler.h in Headers */, 11690 5109099723DACBF2003B1E4C /* WKScriptMessageHandlerWithReply.h in Headers */, 11684 11691 7CC99A3618EF7CBC0048C8B4 /* WKScriptMessageInternal.h in Headers */, 11685 11692 0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */, … … 12739 12746 2D54C31B212F4DA60049C174 /* ProcessLauncher.cpp in Sources */, 12740 12747 CD2865EF2255562000606AC7 /* ProcessTaskStateObserver.mm in Sources */, 12748 1A0C225E243575CD00ED614D /* QuickLookThumbnailLoader.mm in Sources */, 12741 12749 9B1229CE23FF25F2008CA751 /* RemoteAudioDestinationManager.cpp in Sources */, 12742 12750 CDAC20F723FC726C0021DEE3 /* RemoteCDMFactoryProxyMessageReceiver.cpp in Sources */, -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r260381 r260407 6842 6842 } 6843 6843 6844 void WebPage::updateAttachmentIcon(const String& identifier, const ShareableBitmap::Handle& qlThumbnailHandle) 6845 { 6846 if (auto attachment = attachmentElementWithIdentifier(identifier)) { 6847 if (RefPtr<ShareableBitmap> thumbnail = !qlThumbnailHandle.isNull() ? ShareableBitmap::create(qlThumbnailHandle) : nullptr) 6848 attachment->updateThumbnail(thumbnail->createImage()); 6849 } 6850 } 6851 6844 6852 RefPtr<HTMLAttachmentElement> WebPage::attachmentElementWithIdentifier(const String& identifier) const 6845 6853 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r260381 r260407 50 50 #include "SandboxExtension.h" 51 51 #include "ShareSheetCallbackID.h" 52 #include "ShareableBitmap.h" 52 53 #include "SharedMemory.h" 53 54 #include "StorageNamespaceIdentifier.h" … … 1219 1220 void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID); 1220 1221 void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::SharedBufferDataReference& enclosingImageData, CallbackID); 1222 void updateAttachmentIcon(const String& identifier, const ShareableBitmap::Handle& qlThumbnailHandle); 1221 1223 #endif 1222 1224 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r260381 r260407 561 561 InsertAttachment(String identifier, Optional<uint64_t> fileSize, String fileName, String contentType, WebKit::CallbackID callbackID) 562 562 UpdateAttachmentAttributes(String identifier, Optional<uint64_t> fileSize, String contentType, String fileName, IPC::SharedBufferDataReference enclosingImageData, WebKit::CallbackID callbackID) 563 UpdateAttachmentIcon(String identifier, WebKit::ShareableBitmap::Handle qlThumbnailHandle) 563 564 #endif 564 565
Note: See TracChangeset
for help on using the changeset viewer.