Bug 1589922 - Change OnItem{Unichar}PropertyChanged to use smart strings in nsIFolderListener.idl. r=aceman
authorJorg K <jorgk@jorgk.com>
Sun, 20 Oct 2019 11:19:45 +0200
changeset 37195 32e57b35f3f0e1c77f7736851e8f4e7377263a95
parent 37194 b0211b8216502b456a5cac312f82407fbcdf3c44
child 37196 432747ceaabea65489c44cb156e81cb33ac032ef
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersaceman
bugs1589922
Bug 1589922 - Change OnItem{Unichar}PropertyChanged to use smart strings in nsIFolderListener.idl. r=aceman
mailnews/base/public/nsIFolderListener.idl
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMessengerOSXIntegration.mm
mailnews/base/src/nsMessengerUnixIntegration.cpp
mailnews/base/src/nsMessengerWinIntegration.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgMailSession.cpp
mailnews/base/src/nsStatusBarBiffManager.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/local/src/nsLocalUndoTxn.cpp
--- a/mailnews/base/public/nsIFolderListener.idl
+++ b/mailnews/base/public/nsIFolderListener.idl
@@ -18,18 +18,18 @@ interface nsIFolderListener : nsISupport
 
   const folderListenerNotifyFlagValue removed = 0x2;
   void OnItemRemoved(in nsIMsgFolder aParentItem,
                      in nsISupports aItem);
 
   const folderListenerNotifyFlagValue propertyChanged = 0x4;
   void OnItemPropertyChanged(in nsIMsgFolder aItem,
                              in ACString aProperty,
-                             in string aOldValue,
-                             in string aNewValue);
+                             in AUTF8String aOldValue,
+                             in AUTF8String aNewValue);
 
   const folderListenerNotifyFlagValue intPropertyChanged = 0x8;
   // While this property handles long long (64bit wide) values,
   // the Javascript engine will only pass values up to 2^53 to the consumers.
   void OnItemIntPropertyChanged(in nsIMsgFolder aItem,
                                 in ACString aProperty,
                                 in long long aOldValue,
                                 in long long aNewValue);
@@ -38,18 +38,18 @@ interface nsIFolderListener : nsISupport
   void OnItemBoolPropertyChanged(in nsIMsgFolder aItem,
                                  in ACString aProperty,
                                  in boolean aOldValue,
                                  in boolean aNewValue);
 
   const folderListenerNotifyFlagValue unicharPropertyChanged = 0x20;
   void OnItemUnicharPropertyChanged(in nsIMsgFolder aItem,
                                     in ACString aProperty,
-                                    in wstring aOldValue,
-                                    in wstring aNewValue);
+                                    in AString aOldValue,
+                                    in AString aNewValue);
 
   const folderListenerNotifyFlagValue propertyFlagChanged = 0x40;
   void OnItemPropertyFlagChanged(in nsIMsgDBHdr aItem,
                                  in ACString aProperty,
                                  in unsigned long aOldFlag,
                                  in unsigned long aNewFlag);
 
   const folderListenerNotifyFlagValue event = 0x80;
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -2022,18 +2022,18 @@ NS_IMETHODIMP nsMessenger::OnItemRemoved
       }
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMessenger::OnItemPropertyChanged(nsIMsgFolder *item,
                                                  const nsACString &property,
-                                                 const char *oldValue,
-                                                 const char *newValue) {
+                                                 const nsACString &oldValue,
+                                                 const nsACString &newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMessenger::OnItemIntPropertyChanged(nsIMsgFolder *item,
                                                     const nsACString &property,
                                                     int64_t oldValue,
                                                     int64_t newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
@@ -2042,18 +2042,18 @@ NS_IMETHODIMP nsMessenger::OnItemIntProp
 NS_IMETHODIMP nsMessenger::OnItemBoolPropertyChanged(nsIMsgFolder *item,
                                                      const nsACString &property,
                                                      bool oldValue,
                                                      bool newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMessenger::OnItemUnicharPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue,
-    const char16_t *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsAString &oldValue,
+    const nsAString &newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMessenger::OnItemPropertyFlagChanged(nsIMsgDBHdr *item,
                                                      const nsACString &property,
                                                      uint32_t oldFlag,
                                                      uint32_t newFlag) {
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/mailnews/base/src/nsMessengerOSXIntegration.mm
+++ b/mailnews/base/src/nsMessengerOSXIntegration.mm
@@ -162,24 +162,24 @@ nsresult nsMessengerOSXIntegration::Init
   nsresult rv;
   nsCOMPtr<nsIObserverService> observerService =
       do_GetService("@mozilla.org/observer-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return observerService->AddObserver(this, "mail-startup-done", false);
 }
 
 NS_IMETHODIMP
-nsMessengerOSXIntegration::OnItemPropertyChanged(nsIMsgFolder *, const nsACString &, char const *,
-                                                 char const *) {
+nsMessengerOSXIntegration::OnItemPropertyChanged(nsIMsgFolder *, const nsACString &,
+                                                 const nsACString &, const nsACString &) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, const nsACString &,
-                                                        const char16_t *, const char16_t *) {
+                                                        const nsAString &, const nsAString &) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *) { return NS_OK; }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::Observe(nsISupports *aSubject, const char *aTopic,
--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -114,25 +114,26 @@ nsresult nsMessengerUnixIntegration::Ini
   NS_ENSURE_SUCCESS(rv, rv);
   return mailSession->AddFolderListener(this,
                                         nsIFolderListener::intPropertyChanged);
 }
 
 NS_IMETHODIMP
 nsMessengerUnixIntegration::OnItemPropertyChanged(nsIMsgFolder *,
                                                   const nsACString &,
-                                                  char const *, char const *) {
+                                                  const nsACString &,
+                                                  const nsACString &) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerUnixIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *,
                                                          const nsACString &,
-                                                         const char16_t *,
-                                                         const char16_t *) {
+                                                         const nsAString &,
+                                                         const nsAString &) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerUnixIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *) {
   return NS_OK;
 }
 
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -343,25 +343,26 @@ nsresult nsMessengerWinIntegration::Init
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerWinIntegration::OnItemPropertyChanged(nsIMsgFolder *,
                                                  const nsACString &,
-                                                 char const *, char const *) {
+                                                 const nsACString &,
+                                                 const nsACString &) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerWinIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *,
                                                         const nsACString &,
-                                                        const char16_t *,
-                                                        const char16_t *) {
+                                                        const nsAString &,
+                                                        const nsAString &) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessengerWinIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *) {
   return NS_OK;
 }
 
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -3182,18 +3182,18 @@ NS_IMETHODIMP nsMsgAccountManager::OnIte
       }
     }
   }
 
   return rv;
 }
 
 NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char *oldValue,
-    const char *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsACString &oldValue,
+    const nsACString &newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::OnItemIntPropertyChanged(nsIMsgFolder *aFolder,
                                               const nsACString &aProperty,
                                               int64_t oldValue,
                                               int64_t newValue) {
@@ -3286,18 +3286,18 @@ nsresult nsMsgAccountManager::RemoveFold
 
 NS_IMETHODIMP nsMsgAccountManager::OnItemBoolPropertyChanged(
     nsIMsgFolder *item, const nsACString &property, bool oldValue,
     bool newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMsgAccountManager::OnItemUnicharPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue,
-    const char16_t *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsAString &oldValue,
+    const nsAString &newValue) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyFlagChanged(
     nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag,
     uint32_t newFlag) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
--- a/mailnews/base/src/nsMsgMailSession.cpp
+++ b/mailnews/base/src/nsMsgMailSession.cpp
@@ -79,28 +79,28 @@ NS_IMETHODIMP nsMsgMailSession::RemoveFo
     if (fL.mNotifyFlags & nsIFolderListener::propertyflag_)            \
       fL.mListener->propertyfunc_ params_;                             \
   }                                                                    \
   PR_END_MACRO
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemPropertyChanged(nsIMsgFolder *aItem,
                                         const nsACString &aProperty,
-                                        const char *aOldValue,
-                                        const char *aNewValue) {
+                                        const nsACString &aOldValue,
+                                        const nsACString &aNewValue) {
   NOTIFY_FOLDER_LISTENERS(propertyChanged, OnItemPropertyChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemUnicharPropertyChanged(nsIMsgFolder *aItem,
                                                const nsACString &aProperty,
-                                               const char16_t *aOldValue,
-                                               const char16_t *aNewValue) {
+                                               const nsAString &aOldValue,
+                                               const nsAString &aNewValue) {
   NOTIFY_FOLDER_LISTENERS(unicharPropertyChanged, OnItemUnicharPropertyChanged,
                           (aItem, aProperty, aOldValue, aNewValue));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgMailSession::OnItemIntPropertyChanged(nsIMsgFolder *aItem,
                                            const nsACString &aProperty,
--- a/mailnews/base/src/nsStatusBarBiffManager.cpp
+++ b/mailnews/base/src/nsStatusBarBiffManager.cpp
@@ -151,18 +151,18 @@ NS_IMETHODIMP
 nsStatusBarBiffManager::OnItemRemoved(nsIMsgFolder *parentItem,
                                       nsISupports *item) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsStatusBarBiffManager::OnItemPropertyChanged(nsIMsgFolder *item,
                                               const nsACString &property,
-                                              const char *oldValue,
-                                              const char *newValue) {
+                                              const nsACString &oldValue,
+                                              const nsACString &newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsStatusBarBiffManager::OnItemIntPropertyChanged(nsIMsgFolder *item,
                                                  const nsACString &property,
                                                  int64_t oldValue,
                                                  int64_t newValue) {
@@ -197,20 +197,19 @@ NS_IMETHODIMP
 nsStatusBarBiffManager::OnItemBoolPropertyChanged(nsIMsgFolder *item,
                                                   const nsACString &property,
                                                   bool oldValue,
                                                   bool newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStatusBarBiffManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item,
-                                                     const nsACString &property,
-                                                     const char16_t *oldValue,
-                                                     const char16_t *newValue) {
+nsStatusBarBiffManager::OnItemUnicharPropertyChanged(
+    nsIMsgFolder *item, const nsACString &property, const nsAString &oldValue,
+    const nsAString &newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsStatusBarBiffManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item,
                                                   const nsACString &property,
                                                   uint32_t oldFlag,
                                                   uint32_t newFlag) {
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -4556,43 +4556,41 @@ NS_IMETHODIMP nsMsgDBFolder::CopyDataDon
   }                                                                    \
   PR_END_MACRO
 
 NS_IMETHODIMP
 nsMsgDBFolder::NotifyPropertyChanged(const nsACString &aProperty,
                                      const nsACString &aOldValue,
                                      const nsACString &aNewValue) {
   NOTIFY_LISTENERS(OnItemPropertyChanged,
-                   (this, aProperty, nsCString(aOldValue).get(),
-                    nsCString(aNewValue).get()));
+                   (this, aProperty, aOldValue, aNewValue));
 
   // Notify listeners who listen to every folder
   nsresult rv;
   nsCOMPtr<nsIFolderListener> folderListenerManager =
       do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
-  return folderListenerManager->OnItemPropertyChanged(
-      this, aProperty, nsCString(aOldValue).get(), nsCString(aNewValue).get());
+  return folderListenerManager->OnItemPropertyChanged(this, aProperty,
+                                                      aOldValue, aNewValue);
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::NotifyUnicharPropertyChanged(const nsACString &aProperty,
                                             const nsAString &aOldValue,
                                             const nsAString &aNewValue) {
-  NOTIFY_LISTENERS(
-      OnItemUnicharPropertyChanged,
-      (this, aProperty, nsString(aOldValue).get(), nsString(aNewValue).get()));
+  NOTIFY_LISTENERS(OnItemUnicharPropertyChanged,
+                   (this, aProperty, aOldValue, aNewValue));
 
   // Notify listeners who listen to every folder
   nsresult rv;
   nsCOMPtr<nsIFolderListener> folderListenerManager =
       do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return folderListenerManager->OnItemUnicharPropertyChanged(
-      this, aProperty, nsString(aOldValue).get(), nsString(aNewValue).get());
+      this, aProperty, aOldValue, aNewValue);
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::NotifyIntPropertyChanged(const nsACString &aProperty,
                                         int64_t aOldValue, int64_t aNewValue) {
   // Don't send off count notifications if they are turned off.
   if (!mNotifyCountChanges && (aProperty.Equals(kTotalMessages) ||
                                aProperty.Equals(kTotalUnreadMessages)))
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -1331,18 +1331,18 @@ nsMsgSendLater::OnItemAdded(nsIMsgFolder
 NS_IMETHODIMP
 nsMsgSendLater::OnItemRemoved(nsIMsgFolder *aParentItem, nsISupports *aItem) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemPropertyChanged(nsIMsgFolder *aItem,
                                       const nsACString &aProperty,
-                                      const char *aOldValue,
-                                      const char *aNewValue) {
+                                      const nsACString &aOldValue,
+                                      const nsACString &aNewValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemIntPropertyChanged(nsIMsgFolder *aItem,
                                          const nsACString &aProperty,
                                          int64_t aOldValue, int64_t aNewValue) {
   return NS_OK;
@@ -1353,18 +1353,18 @@ nsMsgSendLater::OnItemBoolPropertyChange
                                           const nsACString &aProperty,
                                           bool aOldValue, bool aNewValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemUnicharPropertyChanged(nsIMsgFolder *aItem,
                                              const nsACString &aProperty,
-                                             const char16_t *aOldValue,
-                                             const char16_t *aNewValue) {
+                                             const nsAString &aOldValue,
+                                             const nsAString &aNewValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::OnItemPropertyFlagChanged(nsIMsgDBHdr *aItem,
                                           const nsACString &aProperty,
                                           uint32_t aOldValue,
                                           uint32_t aNewValue) {
--- a/mailnews/local/src/nsLocalUndoTxn.cpp
+++ b/mailnews/local/src/nsLocalUndoTxn.cpp
@@ -393,36 +393,36 @@ NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnI
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemRemoved(nsIMsgFolder *parentItem,
                                                    nsISupports *item) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char *oldValue,
-    const char *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsACString &oldValue,
+    const nsACString &newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemIntPropertyChanged(
     nsIMsgFolder *item, const nsACString &property, int64_t oldValue,
     int64_t newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemBoolPropertyChanged(
     nsIMsgFolder *item, const nsACString &property, bool oldValue,
     bool newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemUnicharPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue,
-    const char16_t *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsAString &oldValue,
+    const nsAString &newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalMoveCopyMsgTxn::OnItemPropertyFlagChanged(
     nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag,
     uint32_t newFlag) {
   return NS_OK;
 }
@@ -448,36 +448,36 @@ NS_IMETHODIMP nsLocalUndoFolderListener:
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemRemoved(nsIMsgFolder *parentItem,
                                                        nsISupports *item) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char *oldValue,
-    const char *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsACString &oldValue,
+    const nsACString &newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemIntPropertyChanged(
     nsIMsgFolder *item, const nsACString &property, int64_t oldValue,
     int64_t newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemBoolPropertyChanged(
     nsIMsgFolder *item, const nsACString &property, bool oldValue,
     bool newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemUnicharPropertyChanged(
-    nsIMsgFolder *item, const nsACString &property, const char16_t *oldValue,
-    const char16_t *newValue) {
+    nsIMsgFolder *item, const nsACString &property, const nsAString &oldValue,
+    const nsAString &newValue) {
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalUndoFolderListener::OnItemPropertyFlagChanged(
     nsIMsgDBHdr *item, const nsACString &property, uint32_t oldFlag,
     uint32_t newFlag) {
   return NS_OK;
 }