Images shared to photos via action menu are padded with zeroes at the end
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Mar 2015 22:05:59 +0000 (22:05 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Mar 2015 22:05:59 +0000 (22:05 +0000)
commite5cb48729dfe93a6cabd950bdb72f030e2f1ee0c
treee2d05f8218c08206bb497a74fc889c064af2b82f
parentaf25203658bb170cc9c7320eefbe318dacdb1947
Images shared to photos via action menu are padded with zeroes at the end
https://bugs.webkit.org/show_bug.cgi?id=142985

Reviewed by Anders Carlsson.

* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Send the size of the image separately from the SharedMemory.
The SharedMemory's size can be rounded up, so we need to keep the original
size around in order to write the data to disk.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _hitTestResultImage]):
(-[WKActionMenuController _addImageToPhotos:]):
Use the image size instead of the SharedMemory size.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm