Bug 1625679 - Port bug 1551306: Remove context parameter from nsIProgressEventSink.onProgress() and nsIProgressEventSink.onStatus(). r=Paenglab
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Sat, 28 Mar 2020 21:18:59 +0200
changeset 38607 dec9fba81ba843af8316ff7a00047eb13790a2b2
parent 38606 40fa2ccaa44b82dd735c6859dafe8ee0c7cedb17
child 38608 b90745e722fc45b719b93653425355edbece0d4e
push id400
push userclokep@gmail.com
push dateMon, 04 May 2020 18:56:09 +0000
reviewersPaenglab
bugs1625679, 1551306
Bug 1625679 - Port bug 1551306: Remove context parameter from nsIProgressEventSink.onProgress() and nsIProgressEventSink.onStatus(). r=Paenglab
calendar/providers/ics/CalICSCalendar.jsm
mail/base/content/aboutDialog-appUpdater.js
mailnews/base/src/nsMsgProgress.cpp
mailnews/base/src/nsMsgStatusFeedback.cpp
mailnews/base/util/nsMsgProtocol.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/local/src/nsMailboxProtocol.cpp
mailnews/local/src/nsPop3Protocol.cpp
mailnews/news/src/nsNNTPProtocol.cpp
--- a/calendar/providers/ics/CalICSCalendar.jsm
+++ b/calendar/providers/ics/CalICSCalendar.jsm
@@ -1050,18 +1050,18 @@ httpHooks.prototype = {
       );
 
       cal.provider.sendHttpRequest(streamLoader, etagChannel, etagListener);
     }
     return true;
   },
 
   // nsIProgressEventSink
-  onProgress(aRequest, aContext, aProgress, aProgressMax) {},
-  onStatus(aRequest, aContext, aStatus, aStatusArg) {},
+  onProgress(aRequest, aProgress, aProgressMax) {},
+  onStatus(aRequest, aStatus, aStatusArg) {},
 
   getInterface(aIid) {
     if (aIid.equals(Ci.nsIProgressEventSink)) {
       return this;
     }
     throw Cr.NS_ERROR_NO_INTERFACE;
   },
 };
--- a/mail/base/content/aboutDialog-appUpdater.js
+++ b/mail/base/content/aboutDialog-appUpdater.js
@@ -449,22 +449,22 @@ appUpdater.prototype = {
         this.selectPanel("downloadFailed");
         break;
     }
   },
 
   /**
    * See nsIProgressEventSink.idl
    */
-  onStatus(aRequest, aContext, aStatus, aStatusArg) {},
+  onStatus(aRequest, aStatus, aStatusArg) {},
 
   /**
    * See nsIProgressEventSink.idl
    */
-  onProgress(aRequest, aContext, aProgress, aProgressMax) {
+  onProgress(aRequest, aProgress, aProgressMax) {
     this.downloadStatus.value = DownloadUtils.getTransferTotal(
       aProgress,
       aProgressMax
     );
   },
 
   /**
    * This function registers an observer that watches for the staging process
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -223,29 +223,27 @@ NS_IMETHODIMP nsMsgProgress::GetMsgWindo
   if (m_msgWindow)
     CallQueryReferent(m_msgWindow.get(), aMsgWindow);
   else
     *aMsgWindow = nullptr;
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsMsgProgress::OnProgress(nsIRequest *request, nsISupports *ctxt,
-                                        int64_t aProgress,
+NS_IMETHODIMP nsMsgProgress::OnProgress(nsIRequest *request, int64_t aProgress,
                                         int64_t aProgressMax) {
   // XXX: What should the nsIWebProgress be?
   // XXX: This truncates 64-bit to 32-bit
   return OnProgressChange(nullptr, request, int32_t(aProgress),
                           int32_t(aProgressMax),
                           int32_t(aProgress) /* current total progress */,
                           int32_t(aProgressMax) /* max total progress */);
 }
 
-NS_IMETHODIMP nsMsgProgress::OnStatus(nsIRequest *request, nsISupports *ctxt,
-                                      nsresult aStatus,
+NS_IMETHODIMP nsMsgProgress::OnStatus(nsIRequest *request, nsresult aStatus,
                                       const char16_t *aStatusArg) {
   nsresult rv;
   nsCOMPtr<nsIStringBundleService> sbs =
       mozilla::services::GetStringBundleService();
   NS_ENSURE_TRUE(sbs, NS_ERROR_UNEXPECTED);
   nsString str;
   rv = sbs->FormatStatusMessage(aStatus, aStatusArg, str);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/src/nsMsgStatusFeedback.cpp
+++ b/mailnews/base/src/nsMsgStatusFeedback.cpp
@@ -214,29 +214,28 @@ nsMsgStatusFeedback::StopMeteors() {
 NS_IMETHODIMP nsMsgStatusFeedback::SetWrappedStatusFeedback(
     nsIMsgStatusFeedback* aJSStatusFeedback) {
   NS_ENSURE_ARG_POINTER(aJSStatusFeedback);
   mJSStatusFeedbackWeak = do_GetWeakReference(aJSStatusFeedback);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgStatusFeedback::OnProgress(nsIRequest* request,
-                                              nsISupports* ctxt,
                                               int64_t aProgress,
                                               int64_t aProgressMax) {
   // XXX: What should the nsIWebProgress be?
   // XXX: this truncates 64-bit to 32-bit
   return OnProgressChange(nullptr, request, int32_t(aProgress),
                           int32_t(aProgressMax),
                           int32_t(aProgress) /* current total progress */,
                           int32_t(aProgressMax) /* max total progress */);
 }
 
 NS_IMETHODIMP nsMsgStatusFeedback::OnStatus(nsIRequest* request,
-                                            nsISupports* ctxt, nsresult aStatus,
+                                            nsresult aStatus,
                                             const char16_t* aStatusArg) {
   nsresult rv;
   nsCOMPtr<nsIURI> uri;
   nsString accountName;
   // fetching account name from nsIRequest
   nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
   rv = aChannel->GetURI(getter_AddRefs(uri));
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -707,18 +707,17 @@ nsMsgProtocol::OnTransportStatus(nsITran
   m_url->GetHost(host);
 
   nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url);
   if (mailnewsUrl) {
     nsCOMPtr<nsIMsgIncomingServer> server;
     mailnewsUrl->GetServer(getter_AddRefs(server));
     if (server) server->GetRealHostName(host);
   }
-  mProgressEventSink->OnStatus(this, nullptr, status,
-                               NS_ConvertUTF8toUTF16(host).get());
+  mProgressEventSink->OnStatus(this, status, NS_ConvertUTF8toUTF16(host).get());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgProtocol::GetIsDocument(bool *aIsDocument) {
   return NS_GetIsDocumentChannel(this, aIsDocument);
 }
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -6094,17 +6094,17 @@ NS_IMETHODIMP nsImapMailFolder::SetFileP
 nsresult nsImapMailFolder::DisplayStatusMsg(nsIImapUrl *aImapUrl,
                                             const nsAString &msg) {
   nsCOMPtr<nsIImapMockChannel> mockChannel;
   aImapUrl->GetMockChannel(getter_AddRefs(mockChannel));
   if (mockChannel) {
     nsCOMPtr<nsIProgressEventSink> progressSink;
     mockChannel->GetProgressEventSink(getter_AddRefs(progressSink));
     if (progressSink) {
-      progressSink->OnStatus(mockChannel, nullptr, NS_OK,
+      progressSink->OnStatus(mockChannel, NS_OK,
                              PromiseFlatString(msg).get());  // XXX i18n message
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsImapMailFolder::ProgressStatusString(nsIImapProtocol *aProtocol,
@@ -6147,20 +6147,19 @@ nsImapMailFolder::PercentProgress(nsIIma
     aProtocol->GetRunningImapURL(getter_AddRefs(imapUrl));
     if (imapUrl) {
       nsCOMPtr<nsIImapMockChannel> mockChannel;
       imapUrl->GetMockChannel(getter_AddRefs(mockChannel));
       if (mockChannel) {
         nsCOMPtr<nsIProgressEventSink> progressSink;
         mockChannel->GetProgressEventSink(getter_AddRefs(progressSink));
         if (progressSink) {
-          progressSink->OnProgress(mockChannel, nullptr, aCurrentProgress,
-                                   aMaxProgress);
+          progressSink->OnProgress(mockChannel, aCurrentProgress, aMaxProgress);
           if (aMessage)
-            progressSink->OnStatus(mockChannel, nullptr, NS_OK,
+            progressSink->OnStatus(mockChannel, NS_OK,
                                    aMessage);  // XXX i18n message
         }
       }
     }
   }
   return NS_OK;
 }
 
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -9605,18 +9605,17 @@ nsImapMockChannel::OnTransportStatus(nsI
   m_url->GetHost(host);
 
   nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url);
   if (mailnewsUrl) {
     nsCOMPtr<nsIMsgIncomingServer> server;
     mailnewsUrl->GetServer(getter_AddRefs(server));
     if (server) server->GetRealHostName(host);
   }
-  mProgressEventSink->OnStatus(this, nullptr, status,
-                               NS_ConvertUTF8toUTF16(host).get());
+  mProgressEventSink->OnStatus(this, status, NS_ConvertUTF8toUTF16(host).get());
 
   return NS_OK;
 }
 
 nsIMAPMailboxInfo::nsIMAPMailboxInfo(const nsACString &aName, char aDelimiter) {
   mMailboxName.Assign(aName);
   mDelimiter = aDelimiter;
   mChildrenListed = false;
--- a/mailnews/local/src/nsMailboxProtocol.cpp
+++ b/mailnews/local/src/nsMailboxProtocol.cpp
@@ -622,18 +622,17 @@ int32_t nsMailboxProtocol::ReadMessageRe
     PR_Free(line);
   }
 
   SetFlag(MAILBOX_PAUSE_FOR_READ);  // wait for more data to become available...
   if (mProgressEventSink && m_runningUrl) {
     int64_t maxProgress;
     nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl(do_QueryInterface(m_runningUrl));
     mailnewsUrl->GetMaxProgress(&maxProgress);
-    mProgressEventSink->OnProgress(this, nullptr, mCurrentProgress,
-                                   maxProgress);
+    mProgressEventSink->OnProgress(this, mCurrentProgress, maxProgress);
   }
 
   if (NS_FAILED(rv)) return -1;
 
   return 0;
 }
 
 /*
--- a/mailnews/local/src/nsPop3Protocol.cpp
+++ b/mailnews/local/src/nsPop3Protocol.cpp
@@ -583,24 +583,24 @@ void nsPop3Protocol::UpdateStatus(const 
   nsString statusMessage;
   mLocalBundle->GetStringFromName(aStatusName, statusMessage);
   UpdateStatusWithString(statusMessage.get());
 }
 
 void nsPop3Protocol::UpdateStatusWithString(const char16_t *aStatusString) {
   if (mProgressEventSink) {
     mozilla::DebugOnly<nsresult> rv = mProgressEventSink->OnStatus(
-        this, nullptr, NS_OK, aStatusString);  // XXX i18n message
+        this, NS_OK, aStatusString);  // XXX i18n message
     NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result");
   }
 }
 
 void nsPop3Protocol::UpdateProgressPercent(int64_t totalDone, int64_t total) {
   if (mProgressEventSink)
-    mProgressEventSink->OnProgress(this, nullptr, totalDone, total);
+    mProgressEventSink->OnProgress(this, totalDone, total);
 }
 
 // note:  SetUsername() expects an unescaped string
 // do not pass in an escaped string
 void nsPop3Protocol::SetUsername(const char *name) {
   NS_ASSERTION(name, "no name specified!");
   if (name) m_username = name;
 }
@@ -2991,18 +2991,17 @@ int32_t nsPop3Protocol::SendRetr() {
     } else {
       nsString finalString;
       mozilla::DebugOnly<nsresult> rv =
           FormatCounterString(NS_LITERAL_STRING("receivingMessages"),
                               m_pop3ConData->real_new_counter,
                               m_pop3ConData->really_new_messages, finalString);
       NS_ASSERTION(NS_SUCCEEDED(rv), "couldn't format string");
       if (mProgressEventSink) {
-        rv = mProgressEventSink->OnStatus(this, nullptr, NS_OK,
-                                          finalString.get());
+        rv = mProgressEventSink->OnStatus(this, NS_OK, finalString.get());
         NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result");
       }
     }
 
     status = Pop3SendData(cmd);
   }  // if cmd
   PR_Free(cmd);
   return status;
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -4400,24 +4400,24 @@ nsresult nsNNTPProtocol::CloseSocket() {
   CleanupAfterRunningUrl();  // is this needed?
   return nsMsgProtocol::CloseSocket();
 }
 
 void nsNNTPProtocol::SetProgressBarPercent(uint32_t aProgress,
                                            uint32_t aProgressMax) {
   // XXX 64-bit
   if (mProgressEventSink)
-    mProgressEventSink->OnProgress(this, nullptr, uint64_t(aProgress),
+    mProgressEventSink->OnProgress(this, uint64_t(aProgress),
                                    uint64_t(aProgressMax));
 }
 
 nsresult nsNNTPProtocol::SetProgressStatus(const char16_t *aMessage) {
   nsresult rv = NS_OK;
   if (mProgressEventSink)
-    rv = mProgressEventSink->OnStatus(this, nullptr, NS_OK, aMessage);
+    rv = mProgressEventSink->OnStatus(this, NS_OK, aMessage);
   return rv;
 }
 
 NS_IMETHODIMP nsNNTPProtocol::GetContentType(nsACString &aContentType) {
   // if we've been set with a content type, then return it....
   // this happens when we go through libmime now as it sets our new content type
   if (!mContentType.IsEmpty()) {
     aContentType = mContentType;