WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
234266
Attachment does not update after markup.
https://bugs.webkit.org/show_bug.cgi?id=234266
Summary
Attachment does not update after markup.
Megan Gardner
Reported
2021-12-13 14:08:09 PST
Attachment does not update after markup.
Attachments
Patch
(1.71 KB, patch)
2021-12-13 14:11 PST
,
Megan Gardner
wenson_hsieh
: review+
Details
Formatted Diff
Diff
Patch
(2.23 KB, patch)
2021-12-13 14:35 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Patch
(2.51 KB, patch)
2021-12-13 14:54 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Megan Gardner
Comment 1
2021-12-13 14:11:20 PST
Created
attachment 447062
[details]
Patch
Wenson Hsieh
Comment 2
2021-12-13 14:15:26 PST
Comment on
attachment 447062
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=447062&action=review
> Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm:158 > + _menuProxy->page()->didInvalidateDataForAttachment(*apiAttachment.get());
Not new in this patch, but we should weakly capture WebPageProxy here (instead of accessing it through the raw pointer to _menuProxy.)
Wenson Hsieh
Comment 3
2021-12-13 14:16:14 PST
Comment on
attachment 447062
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=447062&action=review
>> Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm:158 >> + _menuProxy->page()->didInvalidateDataForAttachment(*apiAttachment.get()); > > Not new in this patch, but we should weakly capture WebPageProxy here (instead of accessing it through the raw pointer to _menuProxy.)
(Let's also add a null check for `apiAttachment`, since it's not guaranteed that the attachment ID will map to an actual API::Attachment here)
Megan Gardner
Comment 4
2021-12-13 14:35:32 PST
Created
attachment 447068
[details]
Patch
Wenson Hsieh
Comment 5
2021-12-13 14:39:55 PST
Comment on
attachment 447068
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=447068&action=review
> Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm:166 > [itemProvider loadDataRepresentationForTypeIdentifier:(NSString *)kUTTypeData completionHandler:^(NSData *data, NSError *error) { > + WeakPtr webPage = _menuProxy->page(); > + > + if (!webPage) > + return; > + > if (error) > return; > > - auto apiAttachment = _menuProxy->page()->attachmentForIdentifier(_attachmentID); > + auto apiAttachment = webPage->attachmentForIdentifier(_attachmentID); > + if (!apiAttachment) > + return; > + > auto attachment = wrapper(apiAttachment); > [attachment setData:data newContentType:String(NSPasteboardTypeTIFF)]; > + webPage->didInvalidateDataForAttachment(*apiAttachment.get());
You probably want something like this: ``` WeakPtr weakPage = _menuProxy->page(); [itemProvider loadDataRepresentationForTypeIdentifier:(NSString *)kUTTypeData completionHandler:[weakPage, attachmentID = _attachmentID](NSData *data, NSError *error) { RefPtr webPage = weakPage.get(); if (!webPage) return; if (error) return; auto apiAttachment = webPage->attachmentForIdentifier(attachmentID); if (!apiAttachment) return; auto attachment = wrapper(apiAttachment); [attachment setData:data newContentType:String(NSPasteboardTypeTIFF)]; webPage->didInvalidateDataForAttachment(*apiAttachment.get()); }]; ```
Megan Gardner
Comment 6
2021-12-13 14:54:18 PST
Created
attachment 447072
[details]
Patch
Wenson Hsieh
Comment 7
2021-12-13 14:57:52 PST
Comment on
attachment 447072
[details]
Patch r=mews
EWS
Comment 8
2021-12-14 11:24:18 PST
Committed
r287034
(
245234@main
): <
https://commits.webkit.org/245234@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 447072
[details]
.
Radar WebKit Bug Importer
Comment 9
2021-12-14 11:25:16 PST
<
rdar://problem/86480352
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug