Bug 1536345 - Add comments to DataTransfer::GetExternalTransferableFormats() and DataTransfer::GetExternalClipboardFormats() to keep them similar r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 19 Mar 2019 08:21:05 +0000
changeset 464951 bf9b2833941317176517671801679bfdab37c665
parent 464950 235447d3f451189998d88bfe2e72a4a61f3b3124
child 464952 c8c4ac7eaceeb3116d1dc0b7ace3e7d65f03da3e
push id112486
push useropoprus@mozilla.com
push dateTue, 19 Mar 2019 16:41:04 +0000
treeherdermozilla-inbound@ee866fb50236 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1536345
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1536345 - Add comments to DataTransfer::GetExternalTransferableFormats() and DataTransfer::GetExternalClipboardFormats() to keep them similar r=smaug I forgot to add the comments to keep them similar even though it's mentioned in the review comment. This patch just adds the comments. Differential Revision: https://phabricator.services.mozilla.com/D23995
dom/events/DataTransfer.cpp
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -646,16 +646,21 @@ already_AddRefed<DataTransfer> DataTrans
   return dt.forget();
 }
 
 /* static */
 void DataTransfer::GetExternalClipboardFormats(const int32_t& aWhichClipboard,
                                                const bool& aPlainTextOnly,
                                                nsTArray<nsCString>* aResult) {
   MOZ_ASSERT(aResult);
+
+  // NOTE: When you change this method, you may need to change
+  //       GetExternalTransferableFormats() too since those methods should
+  //       work similarly.
+
   nsCOMPtr<nsIClipboard> clipboard =
       do_GetService("@mozilla.org/widget/clipboard;1");
   if (!clipboard || aWhichClipboard < 0) {
     return;
   }
 
   if (aPlainTextOnly) {
     bool hasType;
@@ -691,16 +696,20 @@ void DataTransfer::GetExternalClipboardF
 void DataTransfer::GetExternalTransferableFormats(
     nsITransferable* aTransferable, bool aPlainTextOnly,
     nsTArray<nsCString>* aResult) {
   MOZ_ASSERT(aTransferable);
   MOZ_ASSERT(aResult);
 
   aResult->Clear();
 
+  // NOTE: When you change this method, you may need to change
+  //       GetExternalClipboardFormats() too since those methods should
+  //       work similarly.
+
   AutoTArray<nsCString, 10> flavors;
   aTransferable->FlavorsTransferableCanExport(flavors);
 
   if (aPlainTextOnly) {
     auto index = flavors.IndexOf(NS_LITERAL_CSTRING(kUnicodeMime));
     if (index != flavors.NoIndex) {
       aResult->AppendElement(NS_LITERAL_CSTRING(kUnicodeMime));
     }