Bug 1605262 - Port bug 1598497 - Move canceled attribute to nsIChannel; rs=bustage-fix
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 20 Dec 2019 11:53:10 +1300
changeset 37790 e2bc4de4ca67b44eddfaf6bdc60e3ae7bcd2fff2
parent 37789 164933b1df705b2545d414840282b2506bf78918
child 37791 0873d221c55bdda55795f715ddca8898fd5e64a9
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewersbustage-fix
bugs1605262, 1598497
Bug 1605262 - Port bug 1598497 - Move canceled attribute to nsIChannel; rs=bustage-fix
mailnews/base/util/nsMsgProtocol.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/news/src/nsNntpMockChannel.cpp
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -735,16 +735,23 @@ NS_IMETHODIMP nsMsgProtocol::Cancel(nsre
   if (m_proxyRequest) m_proxyRequest->Cancel(status);
 
   if (m_request) return m_request->Cancel(status);
 
   NS_WARNING("no request to cancel");
   return NS_ERROR_NOT_AVAILABLE;
 }
 
+NS_IMETHODIMP nsMsgProtocol::GetCanceled(bool* aCanceled) {
+  nsresult status = NS_ERROR_FAILURE;
+  GetStatus(&status);
+  *aCanceled = NS_FAILED(status);
+  return NS_OK;
+}
+
 NS_IMETHODIMP nsMsgProtocol::Suspend() {
   if (m_request) return m_request->Suspend();
 
   NS_WARNING("no request to suspend");
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP nsMsgProtocol::Resume() {
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -9464,16 +9464,23 @@ NS_IMETHODIMP nsImapMockChannel::Cancel(
   }
 
   // Required for killing ImapProtocol thread
   if (imapProtocol) imapProtocol->TellThreadToDie(false);
 
   return NS_OK;
 }
 
+NS_IMETHODIMP nsImapMockChannel::GetCanceled(bool* aCanceled) {
+  nsresult status = NS_ERROR_FAILURE;
+  GetStatus(&status);
+  *aCanceled = NS_FAILED(status);
+  return NS_OK;
+}
+
 NS_IMETHODIMP nsImapMockChannel::Suspend() {
   MOZ_ASSERT_UNREACHABLE("nsImapMockChannel::Suspend");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsImapMockChannel::Resume() {
   MOZ_ASSERT_UNREACHABLE("nsImapMockChannel::Resume");
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/mailnews/news/src/nsNntpMockChannel.cpp
+++ b/mailnews/news/src/nsNntpMockChannel.cpp
@@ -62,16 +62,23 @@ NS_IMETHODIMP nsNntpMockChannel::GetStat
 }
 
 NS_IMETHODIMP nsNntpMockChannel::Cancel(nsresult status) {
   m_cancelStatus = status;
   m_channelState = CHANNEL_CLOSED;
   return NS_OK;
 }
 
+NS_IMETHODIMP nsNntpMockChannel::GetCanceled(bool* aCanceled) {
+  nsresult status = NS_ERROR_FAILURE;
+  GetStatus(&status);
+  *aCanceled = NS_FAILED(status);
+  return NS_OK;
+}
+
 NS_IMETHODIMP nsNntpMockChannel::Suspend() {
   MOZ_ASSERT_UNREACHABLE("nsNntpMockChannel::Suspend");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsNntpMockChannel::Resume() {
   MOZ_ASSERT_UNREACHABLE("nsNntpMockChannel::Resume");
   return NS_ERROR_NOT_IMPLEMENTED;