gecko-dev/ipc/ipdl
Anny Gakhokidze 535e3c83a1 Bug 1470540 - Improve performance of DataTransfer::CacheExternalClipboardFormats, r=baku,mccr8
Currently, in order to retrieve supported clipboard formats
DataTransfer::CacheExternalClipboardFormats repeatedly makes the same calls to
clipboard->HasDataMatchingFlavors.

In the case when aPlainTextOnly == true only 1 call is made -
clipboard->HasDataMatchingFlavors(kUnicodeMime, ...), and when
aPlainTextOnly == false we have 1 call made for every member of the list
{ kCustomTypesMime, kFileMime, kHTMLMime, kRTFMime, kURLMime, kURLDataMime,
kUnicodeMime, kPNGImageMime } - a total of 8 calls.

We can see that in nsClipboardProxy::HasDataMatchingFlavors, there is a call to
ContentChild::GetSingleton()->SendClipboardHasType.
So when aPlainTextOnly == true, we will have 1 sync message, and when
aPlainTextOnly == false, we will have 8 sync messages.

With the proposed solution, in DataTransfer::CacheExternalClipboardFormats
we will only have 1 sync message regardless of the case because
GetExternalClipboardFormats() will retrieve all supported clipboard
formats at once.

MozReview-Commit-ID: CAmBfqB459v

--HG--
extra : rebase_source : 27f1b420f2613e6a747ed63762f1583ab71ba3e0
2018-06-22 14:28:27 -04:00
..
ipdl Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
test Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
Makefile.in Bug 1455892 - Use a tracking stub file rather than a phony target to speed up ipdl in incremental builds. r=froydnj 2018-05-03 12:54:21 -07:00
ipdl.py Bug 1468272 - Get rid of the codedir usage as it doesn't exist since 2009 r=froydnj 2018-06-11 17:27:34 -07:00
message-metadata.ini Remove ReadLockHandle and ReadLockInit code (bug 1445008, r=aosmond) 2018-03-13 17:00:18 -05:00
moz.build Bug 1451859 - Part 2: Add sanitizer coverage to a handful of places relevant to IPC. r=posidron 2018-04-05 15:48:11 -04:00
msgtype-components
sync-messages.ini Bug 1470540 - Improve performance of DataTransfer::CacheExternalClipboardFormats, r=baku,mccr8 2018-06-22 14:28:27 -04:00